diff --git a/Cargo.lock b/Cargo.lock index 0812bbe..42f433a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -65,6 +65,7 @@ version = "0.2.0" dependencies = [ "chinese-number", "siphasher", + "unicode-normalization", "ureq", ] @@ -313,12 +314,36 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "tinyvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + [[package]] name = "unicode-ident" version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" +[[package]] +name = "unicode-normalization" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fd4f6878c9cb28d874b009da9e8d183b5abc80117c40bbd187a1fde336be6e8" +dependencies = [ + "tinyvec", +] + [[package]] name = "untrusted" version = "0.9.0" diff --git a/Cargo.toml b/Cargo.toml index ef60841..51a6290 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,10 +15,11 @@ keywords = ["unicode", "symbols"] default = ["numeral-systems", "styling"] numeral-systems = ["dep:chinese-number"] styling = [] -_test-unicode-conformance = ["ureq"] +_test-unicode-conformance = ["ureq", "dep:unicode-normalization"] [dependencies] chinese-number = { version = "0.7.7", default-features = false, features = ["number-to-chinese"], optional = true } +unicode-normalization = { version = "0.1.25", optional = true } [dev-dependencies] siphasher = "1.0.2" diff --git a/src/lib.rs b/src/lib.rs index 0ad21d7..8a91fbc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -191,6 +191,17 @@ mod test { } } + /// Tests that all symbols use NFC, i.e., use precomposed codepoints when + /// possible. + #[cfg(feature = "_test-unicode-conformance")] + #[test] + fn symbols_are_nfc() { + assert!( + are_all_variants_valid(ROOT, unicode_normalization::is_nfc), + "symbols should use NFC (see list above)", + ) + } + /// https://www.unicode.org/reports/tr51/#def_text_presentation_selector. const TEXT_PRESENTATION_SELECTOR: char = '\u{FE0E}'; /// https://www.unicode.org/reports/tr51/#def_emoji_presentation_selector. diff --git a/src/modules/sym.txt b/src/modules/sym.txt index 439ccf1..9557c20 100644 --- a/src/modules/sym.txt +++ b/src/modules/sym.txt @@ -751,13 +751,13 @@ note .up 🎜 .down 🎝 .whole 𝅝 - .half 𝅗𝅥 - .quarter 𝅘𝅥 + .half 𝅗𝅥 + .quarter 𝅘𝅥 .quarter.alt ♩ - .eighth 𝅘𝅥𝅮 + .eighth 𝅘𝅥𝅮 .eighth.alt ♪ .eighth.beamed ♫ - .sixteenth 𝅘𝅥𝅯 + .sixteenth 𝅘𝅥𝅯 .sixteenth.beamed ♬ .grace 𝆕 .grace.slash 𝆔