v0.2.5-pre.009
This commit is contained in:
@@ -1,20 +1,20 @@
|
||||
// file: crates/ksp-logging-lib/unit_tests/domain.rs
|
||||
// version: 1
|
||||
// version: 2
|
||||
|
||||
#[test]
|
||||
fn wildcard_domain_matches_with_or_without_current_domain() {
|
||||
super::set_current_domain(std::option::Option::None);
|
||||
assert!(super::current_domain_matches(&["*".to_string()]));
|
||||
assert!(crate::current_domain_matches(&["*".to_string()]));
|
||||
super::set_current_domain(std::option::Option::Some("logging"));
|
||||
assert!(super::current_domain_matches(&["*".to_string()]));
|
||||
assert!(crate::current_domain_matches(&["*".to_string()]));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn named_domain_requires_current_matching_prefix() {
|
||||
super::set_current_domain(std::option::Option::None);
|
||||
assert!(!super::current_domain_matches(&["logging".to_string()]));
|
||||
assert!(!crate::current_domain_matches(&["logging".to_string()]));
|
||||
super::set_current_domain(std::option::Option::Some("logging.runtime"));
|
||||
assert!(super::current_domain_matches(&["logging".to_string()]));
|
||||
assert!(super::current_domain_matches(&["store".to_string(), "logging.runtime".to_string()]));
|
||||
assert!(!super::current_domain_matches(&["store".to_string()]));
|
||||
assert!(crate::current_domain_matches(&["logging".to_string()]));
|
||||
assert!(crate::current_domain_matches(&["store".to_string(), "logging.runtime".to_string()]));
|
||||
assert!(!crate::current_domain_matches(&["store".to_string()]));
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// file: crates/ksp-logging-lib/unit_tests/writer.rs
|
||||
// version: 2
|
||||
// version: 3
|
||||
|
||||
#[test]
|
||||
fn ansi_writer_strips_csi_sequences() {
|
||||
let mut writer = super::StripAnsiWriter::new(std::vec::Vec::<u8>::new());
|
||||
let mut writer = crate::StripAnsiWriter::new(std::vec::Vec::<u8>::new());
|
||||
let write_result = std::io::Write::write_all(&mut writer, b"before\x1b[31mred\x1b[0mafter");
|
||||
assert!(write_result.is_ok());
|
||||
assert_eq!(writer.into_inner(), b"beforeredafter");
|
||||
@@ -11,7 +11,7 @@ fn ansi_writer_strips_csi_sequences() {
|
||||
|
||||
#[test]
|
||||
fn ansi_writer_preserves_state_across_split_writes() {
|
||||
let mut writer = super::StripAnsiWriter::new(std::vec::Vec::<u8>::new());
|
||||
let mut writer = crate::StripAnsiWriter::new(std::vec::Vec::<u8>::new());
|
||||
let first = std::io::Write::write_all(&mut writer, b"a\x1b[");
|
||||
let second = std::io::Write::write_all(&mut writer, b"32mb");
|
||||
assert!(first.is_ok());
|
||||
@@ -21,7 +21,7 @@ fn ansi_writer_preserves_state_across_split_writes() {
|
||||
|
||||
#[test]
|
||||
fn ansi_writer_strips_osc_sequences_terminated_by_bell_or_st() {
|
||||
let mut writer = super::StripAnsiWriter::new(std::vec::Vec::<u8>::new());
|
||||
let mut writer = crate::StripAnsiWriter::new(std::vec::Vec::<u8>::new());
|
||||
let first = std::io::Write::write_all(&mut writer, b"a\x1b]0;title\x07b");
|
||||
let second = std::io::Write::write_all(&mut writer, b"c\x1b]8;;https://example.invalid\x1b\\d");
|
||||
assert!(first.is_ok());
|
||||
@@ -43,7 +43,7 @@ fn output_level_routing_covers_all_filter_levels() {
|
||||
|
||||
#[test]
|
||||
fn disabled_routed_writer_discards_bytes_without_error() {
|
||||
let mut writer = super::RoutedWriter::<std::vec::Vec<u8>>::Disabled;
|
||||
let mut writer = crate::RoutedWriter::<std::vec::Vec<u8>>::Disabled;
|
||||
let write_result = std::io::Write::write_all(&mut writer, b"discarded");
|
||||
let flush_result = std::io::Write::flush(&mut writer);
|
||||
assert!(write_result.is_ok());
|
||||
|
||||
Reference in New Issue
Block a user