sentry_core

Module test

Source
Expand description

This provides testing functionality for building tests.

Feature: test (disabled by default)

If the sentry crate has been compiled with the test support feature this module becomes available and provides functionality to capture events in a block.

§Example usage

use sentry::test::with_captured_events;
use sentry::{capture_message, Level};

let events = with_captured_events(|| {
    capture_message("Hello World!", Level::Warning);
});
assert_eq!(events.len(), 1);
assert_eq!(events[0].message.as_ref().unwrap(), "Hello World!");

Structs§

Functions§