Skip to content

Commit d42fff2

Browse files
committed
Move src/test.rs to tests/test.rs
Adding various __test_api shims in the process
1 parent b1efa9f commit d42fff2

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

src/__test_api.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,7 @@ pub fn classify_nonstarters(c: char) -> Decomposition {
2626
pub fn stream_safe(s: &str) -> String {
2727
StreamSafe::new(s.chars()).collect()
2828
}
29+
30+
pub mod quick_check {
31+
pub use crate::quick_check::*;
32+
}

src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ mod quick_check;
7373
mod stream_safe;
7474
mod tables;
7575

76-
#[cfg(test)]
77-
mod test;
7876
mod normalization_tests;
7977
#[doc(hidden)]
8078
pub mod __test_api;

src/test.rs renamed to tests/test.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
23
// file at the top-level directory of this distribution and at
34
// http://rust-lang.org/COPYRIGHT.
@@ -9,9 +10,11 @@
910
// except according to those terms.
1011

1112

13+
extern crate unicode_normalization;
14+
1215
use std::char;
13-
use super::UnicodeNormalization;
14-
use super::char::is_combining_mark;
16+
use unicode_normalization::UnicodeNormalization;
17+
use unicode_normalization::char::is_combining_mark;
1518

1619

1720
#[test]
@@ -97,7 +100,7 @@ fn test_nfkc() {
97100

98101
#[test]
99102
fn test_official() {
100-
use normalization_tests::NORMALIZATION_TESTS;
103+
use unicode_normalization::__test_api::NORMALIZATION_TESTS;
101104
macro_rules! normString {
102105
($method: ident, $input: expr) => { $input.$method().collect::<String>() }
103106
}
@@ -161,8 +164,8 @@ fn test_official() {
161164

162165
#[test]
163166
fn test_quick_check() {
164-
use normalization_tests::NORMALIZATION_TESTS;
165-
use quick_check;
167+
use unicode_normalization::__test_api::NORMALIZATION_TESTS;
168+
use unicode_normalization::__test_api::quick_check;
166169
for test in NORMALIZATION_TESTS {
167170
assert!(quick_check::is_nfc(test.nfc));
168171
assert!(quick_check::is_nfd(test.nfd));

0 commit comments

Comments
 (0)