Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add "opt-out" test gating for vendors, document getting working tests#44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions.travis.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,6 +7,9 @@ sudo: false
script:
- cargo build --verbose
- cargo test --verbose
- cargo package
- cd target/package/unicode-normalization-*
- RUSTFLAGS="--cfg minimal_tests" cargo test --verbose
notifications:
email:
on_success: never
2 changes: 1 addition & 1 deletionCargo.toml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,7 +18,7 @@ Decomposition and Recomposition, as described in
Unicode Standard Annex #15.
"""

exclude = [ "target/*", "Cargo.lock", "scripts/tmp", "*.txt", "src/normalization_tests.rs", "src/test.rs" ]
exclude = [ "target/*", "Cargo.lock", "scripts/tmp", "*.txt", "src/normalization_tests.rs" ]

[dependencies]
smallvec = "0.6"
23 changes: 23 additions & 0 deletionsREADME.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,3 +33,26 @@ to your `Cargo.toml`:
[dependencies]
unicode-normalization = "0.1.8"
```

## Linux Vendors / Downstream
As is, tests won't work on the published crate, as important
corpus data required for fully testing functionality otherwise
bloats the size of the crate.

Tests aren't hugely meaningful without this, but there are two
workarounds:

```bash
RUSTFLAGS="--cfg minimal_tests" cargo test
```

This will make the crate compile, and some arbitrary set of lower
quality tests pass.

```bash
python scripts/unicode.py
cp ./normalization_tests.rs src/
```

This will generate the full corpus required for tests to work,
without needing to pass any special flags.
2 changes: 1 addition & 1 deletionsrc/lib.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -75,7 +75,7 @@ mod tables;

#[cfg(test)]
mod test;
#[cfg(test)]
#[cfg(all(test,not(minimal_tests)))]
mod normalization_tests;

/// Methods for composing and decomposing characters.
Expand Down
2 changes: 2 additions & 0 deletionssrc/stream_safe.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -111,6 +111,7 @@ mod tests {
classify_nonstarters,
};
use std::char;
#[cfg(not(minimal_tests))]
use normalization_tests::NORMALIZATION_TESTS;
use normalize::decompose_compatible;
use lookups::canonical_combining_class;
Expand All@@ -119,6 +120,7 @@ mod tests {
StreamSafe::new(s.chars()).collect()
}

#[cfg(not(minimal_tests))]
#[test]
fn test_normalization_tests_unaffected() {
for test in NORMALIZATION_TESTS {
Expand Down
3 changes: 2 additions & 1 deletionsrc/test.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -95,6 +95,7 @@ fn test_nfkc() {
t!("a\u{300}\u{305}\u{315}\u{5ae}b", "\u{e0}\u{5ae}\u{305}\u{315}b");
}

#[cfg(not(minimal_tests))]
#[test]
fn test_official() {
use normalization_tests::NORMALIZATION_TESTS;
Expand DownExpand Up@@ -158,7 +159,7 @@ fn test_official() {
}
}
}

#[cfg(not(minimal_tests))]
#[test]
fn test_quick_check() {
use normalization_tests::NORMALIZATION_TESTS;
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp