8000 Tidy up test layout · unicode-rs/unicode-normalization@830bebf · GitHub
[go: up one dir, main page]

Skip to content

Commit 830bebf

Browse files
committed
Tidy up test layout
- Unify all tests/ into a single file to reduce the number of output targets during `cargo test` - This also avoids double-compiling the normalization_tests.rs - Move normalization_tests.rs to be a child of tests/data/ to avoid getting compiled as a test unit, and further removing useless output from cargo test
1 parent fe93995 commit 830bebf

File tree

3 files changed

+17
-20
lines changed

3 files changed

+17
-20
lines changed
File renamed without changes.

tests/stream_safe_normalization.rs

Lines changed: 0 additions & 17 deletions
This file was deleted.

tests/test_normalization.rs renamed to tests/tests.rs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
11
extern crate unicode_normalization;
22
use unicode_normalization::UnicodeNormalization;
3-
mod normalization_tests;
4-
use normalization_tests::NORMALIZATION_TESTS;
3+
use unicode_normalization::__test_api::{
4+
stream_safe,
5+
};
6+
7+
mod data {
8+
pub mod normalization_tests;
9+
}
10+
use data::normalization_tests::NORMALIZATION_TESTS;
11+
12+
#[test]
13+
fn test_normalization_tests_unaffected() {
14+
for test in NORMALIZATION_TESTS {
15+
for &s in &[test.source, test.nfc, test.nfd, test.nfkc, test.nfkd] {
16+
assert_eq!(stream_safe(s), s);
17+
}
18+
}
19+
}
520

621
#[test]
722
fn test_official() {
@@ -88,4 +103,3 @@ fn test_quick_check() {
88103
}
89104
}
90105
}
91-

0 commit comments

Comments
 (0)
0