Explorar o código

Update tests to Unicode 16.0 (#1045)

* Update tests to Unicode 16.0

* Update CI to test Rust 1.82 (ICU4X 2.0 MSRV) and to downgrade idna_adapter on Rust 1.67

* Drop Rust 1.67 tests
Henri Sivonen hai 1 ano
pai
achega
68f151c016
Modificáronse 5 ficheiros con 459 adicións e 403 borrados
  1. 4 11
      .github/workflows/main.yml
  2. 4 0
      idna/README.md
  3. 445 386
      idna/tests/IdnaTestV2.txt
  4. 2 2
      idna/tests/deprecated.rs
  5. 4 4
      idna/tests/uts46.rs

+ 4 - 11
.github/workflows/main.yml

@@ -15,12 +15,12 @@ jobs:
     strategy:
       matrix:
         os: [ubuntu-latest, macos-latest, windows-latest]
-        rust: [1.63.0, 1.67.0, stable, beta, nightly]
+        rust: [1.63.0, 1.82.0, stable, beta, nightly]
         exclude:
           - os: macos-latest
-            rust: 1.67.0
+            rust: 1.82.0
           - os: windows-latest
-            rust: 1.67.0
+            rust: 1.82.0
           - os: macos-latest
             rust: beta
           - os: windows-latest
@@ -41,13 +41,6 @@ jobs:
           matrix.rust == '1.63.0'
         run: |
           cargo update -p idna_adapter --precise 1.1.0
-      - name: Downgrade deps on Rust 1.67.0
-        if: |
-          matrix.rust == '1.67.0'
-        run: |
-          cargo update -p zerofrom --precise 0.1.4
-          cargo update -p yoke --precise 0.7.4
-          cargo update -p litemap --precise 0.7.3
       - name: Add `aarch64-unknown-none` toolchain for `no_std` tests
         if: |
           matrix.os == 'ubuntu-latest' &&
@@ -66,7 +59,7 @@ jobs:
         if: |
           matrix.os == 'windows-latest' &&
           matrix.rust != '1.63.0' &&
-          matrix.rust != '1.67.0'
+          matrix.rust != '1.82.0'
         run: cargo test --test debugger_visualizer --features "url/debugger_visualizer,url_debug_tests/debugger_visualizer" -- --test-threads=1 || echo "debugger test failed"
         continue-on-error: true # Fails on GH actions, but not locally.
       - name: Test `no_std` support

+ 4 - 0
idna/README.md

@@ -40,3 +40,7 @@ By default, `idna` uses [ICU4X](https://github.com/unicode-org/icu4x/) as its Un
 * The `Idna::to_ascii_inner` method has been removed. It didn't make sense as a public method, since callers were unable to figure out if there were errors. (A GitHub search found no callers for this method.)
 * Punycode labels whose decoding does not yield any non-ASCII characters are now treated as being in error.
 * When turning off default cargo features, the cargo feature `compiled_data` needs to be explicitly enabled.
+
+## License
+
+MIT OR Apache-2.0 for the code. Additionally, there is a test data file, IdnaTestV2.txt, under Unicode-3.0.

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 445 - 386
idna/tests/IdnaTestV2.txt


+ 2 - 2
idna/tests/deprecated.rs

@@ -103,7 +103,7 @@ pub fn collect_tests<F: FnMut(String, TestFn)>(add_test: &mut F) {
                     &source,
                     (&to_ascii_n, &to_ascii_n_status),
                     to_ascii_n_result,
-                    |e| e == "V2",
+                    |e| e == "V2" || e == "A4_2",
                 );
 
                 let to_ascii_t_result = config.transitional_processing(true).to_ascii(&source);
@@ -111,7 +111,7 @@ pub fn collect_tests<F: FnMut(String, TestFn)>(add_test: &mut F) {
                     &source,
                     (&to_ascii_t, &to_ascii_t_status),
                     to_ascii_t_result,
-                    |e| e == "V2",
+                    |e| e == "V2" || e == "A4_2",
                 );
             })),
         )

+ 4 - 4
idna/tests/uts46.rs

@@ -88,7 +88,7 @@ pub fn collect_tests<F: FnMut(String, TestFn)>(add_test: &mut F) {
                     source.as_bytes(),
                     AsciiDenyList::STD3,
                     Hyphens::Check,
-                    DnsLength::VerifyAllowRootDot,
+                    DnsLength::Verify,
                 );
                 check(
                     &source,
@@ -111,7 +111,7 @@ pub fn collect_tests<F: FnMut(String, TestFn)>(add_test: &mut F) {
                     ) {
                     Ok(ProcessingSuccess::Passthrough) => (
                         Ok(source.to_string()),
-                        if verify_dns_length(&source, true) {
+                        if verify_dns_length(&source, false) {
                             Ok(source.to_string())
                         } else {
                             Err(Errors::default())
@@ -121,7 +121,7 @@ pub fn collect_tests<F: FnMut(String, TestFn)>(add_test: &mut F) {
                         if to_ascii_simultaneous.is_empty() {
                             (
                                 Ok(to_unicode_simultaneous.clone()),
-                                if verify_dns_length(&to_unicode_simultaneous, true) {
+                                if verify_dns_length(&to_unicode_simultaneous, false) {
                                     Ok(to_unicode_simultaneous)
                                 } else {
                                     Err(Errors::default())
@@ -130,7 +130,7 @@ pub fn collect_tests<F: FnMut(String, TestFn)>(add_test: &mut F) {
                         } else {
                             (
                                 Ok(to_unicode_simultaneous),
-                                if verify_dns_length(&to_ascii_simultaneous, true) {
+                                if verify_dns_length(&to_ascii_simultaneous, false) {
                                     Ok(to_ascii_simultaneous)
                                 } else {
                                     Err(Errors::default())

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio