diff --git a/components/collections/Cargo.toml b/components/collections/Cargo.toml index d395b139775..f1a17850245 100644 --- a/components/collections/Cargo.toml +++ b/components/collections/Cargo.toml @@ -36,7 +36,7 @@ serde_json = "1.0" icu_benchmark_macros = { path = "../../tools/benchmark/macros" } iai = "0.1.1" icu = { path = "../../components/icu", default-features = false } -icu_properties = { path = "../../components/properties", default-features = false } +icu_properties = { path = "../../components/properties" } [target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] criterion = "0.4" @@ -57,15 +57,15 @@ denylist = ["bench"] [[bench]] name = "codepointtrie" harness = false -path = "src/codepointtrie/benches/codepointtrie.rs" +path = "benches/codepointtrie.rs" [[bench]] name = "iai_cpt" harness = false required-features = ["bench"] -path = "src/codepointtrie/benches/iai_cpt.rs" +path = "benches/iai_cpt.rs" [[bench]] name = "inv_list" harness = false -path = "src/codepointinvlist/benches/inv_list.rs" +path = "benches/inv_list.rs" diff --git a/components/collections/src/codepointtrie/benches/codepointtrie.rs b/components/collections/benches/codepointtrie.rs similarity index 100% rename from components/collections/src/codepointtrie/benches/codepointtrie.rs rename to components/collections/benches/codepointtrie.rs diff --git a/components/collections/src/codepointtrie/benches/iai_cpt.rs b/components/collections/benches/iai_cpt.rs similarity index 100% rename from components/collections/src/codepointtrie/benches/iai_cpt.rs rename to components/collections/benches/iai_cpt.rs diff --git a/components/collections/src/codepointinvlist/benches/inv_list.rs b/components/collections/benches/inv_list.rs similarity index 100% rename from components/collections/src/codepointinvlist/benches/inv_list.rs rename to components/collections/benches/inv_list.rs diff --git a/components/collections/src/codepointtrie/benches/tries/gc_fast.rs b/components/collections/benches/tries/gc_fast.rs similarity index 100% rename from components/collections/src/codepointtrie/benches/tries/gc_fast.rs rename to components/collections/benches/tries/gc_fast.rs diff --git a/components/collections/src/codepointtrie/benches/tries/gc_small.rs b/components/collections/benches/tries/gc_small.rs similarity index 100% rename from components/collections/src/codepointtrie/benches/tries/gc_small.rs rename to components/collections/benches/tries/gc_small.rs diff --git a/components/collections/src/codepointtrie/benches/tries/mod.rs b/components/collections/benches/tries/mod.rs similarity index 100% rename from components/collections/src/codepointtrie/benches/tries/mod.rs rename to components/collections/benches/tries/mod.rs diff --git a/components/collections/src/codepointinvlist/examples/unicode_bmp_blocks_selector.rs b/components/collections/examples/unicode_bmp_blocks_selector.rs similarity index 100% rename from components/collections/src/codepointinvlist/examples/unicode_bmp_blocks_selector.rs rename to components/collections/examples/unicode_bmp_blocks_selector.rs diff --git a/components/collections/src/char16trie/LICENSE b/components/collections/src/char16trie/LICENSE deleted file mode 100644 index c9be6012c53..00000000000 --- a/components/collections/src/char16trie/LICENSE +++ /dev/null @@ -1,46 +0,0 @@ -UNICODE LICENSE V3 - -COPYRIGHT AND PERMISSION NOTICE - -Copyright © 2020-2024 Unicode, Inc. - -NOTICE TO USER: Carefully read the following legal agreement. BY -DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR -SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE -TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT -DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of data files and any associated documentation (the "Data Files") or -software and any associated documentation (the "Software") to deal in the -Data Files or Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, and/or sell -copies of the Data Files or Software, and to permit persons to whom the -Data Files or Software are furnished to do so, provided that either (a) -this copyright and permission notice appear with all copies of the Data -Files or Software, or (b) this copyright and permission notice appear in -associated Documentation. - -THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF -THIRD PARTY RIGHTS. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE -BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, -OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA -FILES OR SOFTWARE. - -Except as contained in this notice, the name of a copyright holder shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in these Data Files or Software without prior written -authorization of the copyright holder. - -SPDX-License-Identifier: Unicode-3.0 - -— - -Portions of ICU4X may have been adapted from ICU4C and/or ICU4J. -ICU 1.8.1 to ICU 57.1 © 1995-2016 International Business Machines Corporation and others. diff --git a/components/collections/src/char16trie/README.md b/components/collections/src/char16trie/README.md deleted file mode 100644 index 0bbd59656f9..00000000000 --- a/components/collections/src/char16trie/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# `Char16Trie` - -This module provides a data structure for a space-efficient and time-efficient lookup of -sequences of 16-bit units (commonly but not necessarily UTF-16 code units) -which map to integer values. - -It is an implementation of the existing [ICU4C UCharsTrie](https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/classicu_1_1UCharsTrie.html) -/ [ICU4J CharsTrie](https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/util/CharsTrie.html) API. - -## Architecture - -ICU4X [`Char16Trie`](crate::char16trie::Char16Trie) is designed to provide a read-only view of UCharsTrie data that is exported from ICU4C. - -## Examples - -### Querying a `Char16Trie` - -```rust -use icu_collections::char16trie::{Char16Trie, TrieResult}; -use zerovec::ZeroVec; - -// A Char16Trie containing the ASCII characters mapping 'a' to 1 and 'ab' -// to 100. -let trie_data = vec![48, 97, 176, 98, 32868]; -let trie = Char16Trie::new(ZeroVec::from_slice_or_alloc(trie_data.as_slice())); - -let mut iter = trie.iter(); -let res = iter.next('a'); -assert_eq!(res, TrieResult::Intermediate(1)); -let res = iter.next('b'); -assert_eq!(res, TrieResult::FinalValue(100)); -let res = iter.next('c'); -assert_eq!(res, TrieResult::NoMatch); -``` - -[`ICU4X`]: ../icu/index.html - -## More Information - -For more information on development, authorship, contributing etc. please visit [`ICU4X home page`](https://github.com/unicode-org/icu4x). diff --git a/components/collections/src/char16trie/tests/test_util.rs b/components/collections/src/char16trie/tests/test_util.rs deleted file mode 100644 index 3dee1822c99..00000000000 --- a/components/collections/src/char16trie/tests/test_util.rs +++ /dev/null @@ -1,14 +0,0 @@ -// This file is part of ICU4X. For terms of use, please see the file -// called LICENSE at the top level of the ICU4X source tree -// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). - - -#[derive(serde::Deserialize)] -pub struct TestFile { - ucharstrie: Char16Trie, -} - -#[derive(serde::Deserialize)] -pub struct Char16Trie { - data: Vec, -} diff --git a/components/collections/src/codepointinvlist/LICENSE b/components/collections/src/codepointinvlist/LICENSE deleted file mode 100644 index c9be6012c53..00000000000 --- a/components/collections/src/codepointinvlist/LICENSE +++ /dev/null @@ -1,46 +0,0 @@ -UNICODE LICENSE V3 - -COPYRIGHT AND PERMISSION NOTICE - -Copyright © 2020-2024 Unicode, Inc. - -NOTICE TO USER: Carefully read the following legal agreement. BY -DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR -SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE -TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT -DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of data files and any associated documentation (the "Data Files") or -software and any associated documentation (the "Software") to deal in the -Data Files or Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, and/or sell -copies of the Data Files or Software, and to permit persons to whom the -Data Files or Software are furnished to do so, provided that either (a) -this copyright and permission notice appear with all copies of the Data -Files or Software, or (b) this copyright and permission notice appear in -associated Documentation. - -THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF -THIRD PARTY RIGHTS. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE -BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, -OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA -FILES OR SOFTWARE. - -Except as contained in this notice, the name of a copyright holder shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in these Data Files or Software without prior written -authorization of the copyright holder. - -SPDX-License-Identifier: Unicode-3.0 - -— - -Portions of ICU4X may have been adapted from ICU4C and/or ICU4J. -ICU 1.8.1 to ICU 57.1 © 1995-2016 International Business Machines Corporation and others. diff --git a/components/collections/src/codepointinvlist/README.md b/components/collections/src/codepointinvlist/README.md deleted file mode 100644 index 6220882e3ad..00000000000 --- a/components/collections/src/codepointinvlist/README.md +++ /dev/null @@ -1,49 +0,0 @@ -# `CodePointInversionList` - -This module provides necessary functionality for highly efficient querying of sets of Unicode characters. - -It is an implementation of the existing [ICU4C UnicodeSet API](https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/classicu_1_1UnicodeSet.html). - -## Architecture -ICU4X [`CodePointInversionList`] is split up into independent levels, with [`CodePointInversionList`] representing the membership/query API, -and [`CodePointInversionListBuilder`] representing the builder API. - -## Examples: - -### Creating a `CodePointInversionList` - -CodePointSets are created from either serialized [`CodePointSets`](CodePointInversionList), -represented by [inversion lists](http://userguide.icu-project.org/strings/properties), -the [`CodePointInversionListBuilder`], or from the Properties API. - -```rust -use icu_collections::codepointinvlist::{CodePointInversionList, CodePointInversionListBuilder}; - -let mut builder = CodePointInversionListBuilder::new(); -builder.add_range(&('A'..'Z')); -let set: CodePointInversionList = builder.build(); - -assert!(set.contains('A')); -``` - -### Querying a `CodePointInversionList` - -Currently, you can check if a character/range of characters exists in the [`CodePointInversionList`], or iterate through the characters. - -```rust -use icu_collections::codepointinvlist::{CodePointInversionList, CodePointInversionListBuilder}; - -let mut builder = CodePointInversionListBuilder::new(); -builder.add_range(&('A'..'Z')); -let set: CodePointInversionList = builder.build(); - -assert!(set.contains('A')); -assert!(set.contains_range(&('A'..='C'))); -assert_eq!(set.iter_chars().next(), Some('A')); -``` - -[`ICU4X`]: ../icu/index.html - -## More Information - -For more information on development, authorship, contributing etc. please visit [`ICU4X home page`](https://github.com/unicode-org/icu4x). diff --git a/components/collections/src/codepointtrie/LICENSE b/components/collections/src/codepointtrie/LICENSE deleted file mode 100644 index c9be6012c53..00000000000 --- a/components/collections/src/codepointtrie/LICENSE +++ /dev/null @@ -1,46 +0,0 @@ -UNICODE LICENSE V3 - -COPYRIGHT AND PERMISSION NOTICE - -Copyright © 2020-2024 Unicode, Inc. - -NOTICE TO USER: Carefully read the following legal agreement. BY -DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR -SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE -TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT -DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of data files and any associated documentation (the "Data Files") or -software and any associated documentation (the "Software") to deal in the -Data Files or Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, and/or sell -copies of the Data Files or Software, and to permit persons to whom the -Data Files or Software are furnished to do so, provided that either (a) -this copyright and permission notice appear with all copies of the Data -Files or Software, or (b) this copyright and permission notice appear in -associated Documentation. - -THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF -THIRD PARTY RIGHTS. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE -BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, -OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA -FILES OR SOFTWARE. - -Except as contained in this notice, the name of a copyright holder shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in these Data Files or Software without prior written -authorization of the copyright holder. - -SPDX-License-Identifier: Unicode-3.0 - -— - -Portions of ICU4X may have been adapted from ICU4C and/or ICU4J. -ICU 1.8.1 to ICU 57.1 © 1995-2016 International Business Machines Corporation and others. diff --git a/components/collections/src/codepointtrie/README.md b/components/collections/src/codepointtrie/README.md deleted file mode 100644 index 595544bc87c..00000000000 --- a/components/collections/src/codepointtrie/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# `CodePointTrie` - -This module provides a data structure for an time-efficient lookup of values -associated to code points. - -It is an implementation of the existing [ICU4C UCPTrie](https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/ucptrie_8h.html) -/ [ICU4J CodePointTrie](https://unicode-org.github.io/icu-docs/apidoc/dev/icu4j/) API. - -## Architecture - -ICU4X [`CodePointTrie`](crate::codepointtrie::CodePointTrie) is designed to provide a read-only view of CodePointTrie data that is exported -from ICU4C. Detailed information about the design of the data structure can be found in the documentation -for the [`CodePointTrie`](crate::codepointtrie::CodePointTrie) struct. - -## Examples - -### Querying a `CodePointTrie` - -```rust -use icu_collections::codepointtrie::planes; -let trie = planes::get_planes_trie(); - -assert_eq!(0, trie.get(0x41)); // 'A' as u32 -assert_eq!(0, trie.get(0x13E0)); // 'Ꮰ' as u32 -assert_eq!(1, trie.get(0x10044)); // '𐁄' as u32 -``` - -[`ICU4X`]: ../icu/index.html - -## More Information - -For more information on development, authorship, contributing etc. please visit [`ICU4X home page`](https://github.com/unicode-org/icu4x). diff --git a/components/collections/src/codepointtrie/tests/planes_test.rs b/components/collections/src/codepointtrie/tests/planes_test.rs deleted file mode 100644 index 9b837a6e63b..00000000000 --- a/components/collections/src/codepointtrie/tests/planes_test.rs +++ /dev/null @@ -1,67 +0,0 @@ -// This file is part of ICU4X. For terms of use, please see the file -// called LICENSE at the top level of the ICU4X source tree -// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). - -mod test_util; - -use icu_collections::codepointtrie::error::Error; -use icu_collections::codepointtrie::planes::get_planes_trie; -use icu_collections::codepointtrie::*; -use test_util::UnicodeEnumeratedProperty; - -use core::convert::TryFrom; -use std::io::Read; -use std::path::Path; -use zerovec::ZeroVec; - -#[test] -fn planes_trie_deserialize_check_test() { - // Get expected planes trie from crate::planes::get_planes_trie() - - let exp_planes_trie = get_planes_trie(); - - // Compute actual planes trie from planes.toml - - let code_point_trie_struct = - toml::from_str::(include_str!("tests/testdata/planes.toml")) - .unwrap() - .code_point_trie - .trie_struct; - - let trie_header = CodePointTrieHeader { - high_start: code_point_trie_struct.high_start, - shifted12_high_start: code_point_trie_struct.shifted12_high_start, - index3_null_offset: code_point_trie_struct.index3_null_offset, - data_null_offset: code_point_trie_struct.data_null_offset, - null_value: code_point_trie_struct.null_value, - trie_type: TrieType::try_from(code_point_trie_struct.trie_type_enum_val).unwrap_or_else( - || { - panic!( - "Could not parse trie_type serialized enum value in test data file: {}", - code_point_trie_struct.name - ) - }, - ), - }; - - let data = ZeroVec::from_slice_or_alloc(code_point_trie_struct.data_8.as_ref().unwrap()); - let index = ZeroVec::from_slice_or_alloc(&code_point_trie_struct.index); - let trie_result: Result, Error> = - CodePointTrie::try_new(trie_header, index, data); - let act_planes_trie = trie_result.unwrap(); - - // Get check ranges (inversion map-style sequence of range+value) and - // apply the trie validation test fn on expected and actual tries - - let serialized_ranges: Vec<(u32, u32, u32)> = planes_enum_prop.code_point_map.data.ranges; - let mut check_ranges: Vec = vec![]; - for range_tuple in serialized_ranges { - let range_end = range_tuple.1 + 1; - let value = range_tuple.2; - check_ranges.push(range_end); - check_ranges.push(value); - } - - test_util::check_trie(&act_planes_trie, &check_ranges); - test_util::check_trie(&exp_planes_trie, &check_ranges); -} diff --git a/components/collections/src/codepointtrie/tests/trie_test_data_test.rs b/components/collections/src/codepointtrie/tests/trie_test_data_test.rs deleted file mode 100644 index 99b621afacb..00000000000 --- a/components/collections/src/codepointtrie/tests/trie_test_data_test.rs +++ /dev/null @@ -1,43 +0,0 @@ -// This file is part of ICU4X. For terms of use, please see the file -// called LICENSE at the top level of the ICU4X source tree -// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). - -mod test_util; - -#[test] -fn code_point_trie_test_data_check_test() { - test_util::run_deserialize_test_from_test_data(include_str!("testdata/free-blocks.16.toml")); - test_util::run_deserialize_test_from_test_data(include_str!("testdata/free-blocks.32.toml")); - test_util::run_deserialize_test_from_test_data(include_str!("testdata/free-blocks.8.toml")); - test_util::run_deserialize_test_from_test_data(include_str!("testdata/free-blocks.small16.toml")); - test_util::run_deserialize_test_from_test_data(include_str!("testdata/grow-data.16.toml")); - test_util::run_deserialize_test_from_test_data(include_str!("testdata/grow-data.32.toml")); - test_util::run_deserialize_test_from_test_data(include_str!("testdata/grow-data.8.toml")); - test_util::run_deserialize_test_from_test_data(include_str!("testdata/grow-data.small16.toml")); - test_util::run_deserialize_test_from_test_data(include_str!("testdata/set1.16.toml")); - test_util::run_deserialize_test_from_test_data(include_str!("testdata/set1.32.toml")); - test_util::run_deserialize_test_from_test_data(include_str!("testdata/set1.8.toml")); - test_util::run_deserialize_test_from_test_data(include_str!("testdata/set1.small16.toml")); - test_util::run_deserialize_test_from_test_data(include_str!("testdata/set2-overlap.16.toml")); - test_util::run_deserialize_test_from_test_data(include_str!("testdata/set2-overlap.32.toml")); - test_util::run_deserialize_test_from_test_data(include_str!("testdata/set2-overlap.small16.toml")); - test_util::run_deserialize_test_from_test_data(include_str!("testdata/set3-initial-9.16.toml")); - test_util::run_deserialize_test_from_test_data(include_str!("testdata/set3-initial-9.32.toml")); - test_util::run_deserialize_test_from_test_data(include_str!("testdata/set3-initial-9.8.toml")); - test_util::run_deserialize_test_from_test_data(include_str!("testdata/set3-initial-9.small16.toml")); - test_util::run_deserialize_test_from_test_data(include_str!("testdata/set-empty.16.toml")); - test_util::run_deserialize_test_from_test_data(include_str!("testdata/set-empty.32.toml")); - test_util::run_deserialize_test_from_test_data(include_str!("testdata/set-empty.8.toml")); - test_util::run_deserialize_test_from_test_data(include_str!("testdata/set-empty.small16.toml")); - test_util::run_deserialize_test_from_test_data(include_str!("testdata/set-single-value.16.toml")); - test_util::run_deserialize_test_from_test_data(include_str!("testdata/set-single-value.32.toml")); - test_util::run_deserialize_test_from_test_data(include_str!("testdata/set-single-value.8.toml")); - test_util::run_deserialize_test_from_test_data(include_str!("testdata/set-single-value.small16.toml")); - test_util::run_deserialize_test_from_test_data(include_str!("testdata/short-all-same.16.toml")); - test_util::run_deserialize_test_from_test_data(include_str!("testdata/short-all-same.8.toml")); - test_util::run_deserialize_test_from_test_data(include_str!("testdata/short-all-same.small16.toml")); - test_util::run_deserialize_test_from_test_data(include_str!("testdata/small0-in-fast.16.toml")); - test_util::run_deserialize_test_from_test_data(include_str!("testdata/small0-in-fast.32.toml")); - test_util::run_deserialize_test_from_test_data(include_str!("testdata/small0-in-fast.8.toml")); - test_util::run_deserialize_test_from_test_data(include_str!("testdata/small0-in-fast.small16.toml")); -} diff --git a/components/collections/src/char16trie/tests/trie_tests.rs b/components/collections/tests/char16trie.rs similarity index 86% rename from components/collections/src/char16trie/tests/trie_tests.rs rename to components/collections/tests/char16trie.rs index f490c4d06a0..ac0308870c7 100644 --- a/components/collections/src/char16trie/tests/trie_tests.rs +++ b/components/collections/tests/char16trie.rs @@ -2,14 +2,12 @@ // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). -mod test_util; - use icu_collections::char16trie::{Char16Trie, TrieResult}; use zerovec::ZeroVec; #[test] -fn char16trie_test_empty() { - let trie_data = toml::from_str::(include_str!("testdata/empty.toml")) +fn empty() { + let trie_data = toml::from_str::(include_str!("data/char16trie/empty.toml")) .unwrap() .ucharstrie .data; @@ -19,8 +17,8 @@ fn char16trie_test_empty() { } #[test] -fn char16trie_test_a() { - let trie_data = toml::from_str::(include_str!("testdata/test_a.toml")) +fn a() { + let trie_data = toml::from_str::(include_str!("data/char16trie/test_a.toml")) .unwrap() .ucharstrie .data; @@ -38,8 +36,8 @@ fn char16trie_test_a() { } #[test] -fn char16trie_test_a_b() { - let trie_data = toml::from_str::(include_str!("testdata/test_a_ab.toml")) +fn a_b() { + let trie_data = toml::from_str::(include_str!("data/char16trie/test_a_ab.toml")) .unwrap() .ucharstrie .data; @@ -61,11 +59,12 @@ fn char16trie_test_a_b() { } #[test] -fn char16trie_test_shortest_branch() { - let trie_data = toml::from_str::(include_str!("testdata/test_shortest_branch.toml")) - .unwrap() - .ucharstrie - .data; +fn shortest_branch() { + let trie_data = + toml::from_str::(include_str!("data/char16trie/test_shortest_branch.toml")) + .unwrap() + .ucharstrie + .data; let trie = Char16Trie::new(ZeroVec::from_slice_or_alloc(trie_data.as_slice())); let mut iter = trie.iter(); @@ -82,8 +81,8 @@ fn char16trie_test_shortest_branch() { } #[test] -fn char16trie_test_branches() { - let trie_data = toml::from_str::(include_str!("testdata/test_branches.toml")) +fn branches() { + let trie_data = toml::from_str::(include_str!("data/char16trie/test_branches.toml")) .unwrap() .ucharstrie .data; @@ -118,11 +117,12 @@ fn char16trie_test_branches() { } #[test] -fn char16trie_test_long_sequence() { - let trie_data = toml::from_str::(include_str!("testdata/test_long_sequence.toml")) - .unwrap() - .ucharstrie - .data; +fn long_sequence() { + let trie_data = + toml::from_str::(include_str!("data/char16trie/test_long_sequence.toml")) + .unwrap() + .ucharstrie + .data; let trie = Char16Trie::new(ZeroVec::from_slice_or_alloc(trie_data.as_slice())); for (query, expected) in [ @@ -162,11 +162,12 @@ fn char16trie_test_long_sequence() { } #[test] -fn char16trie_test_long_branch() { - let trie_data = toml::from_str::(include_str!("testdata/test_long_branch.toml")) - .unwrap() - .ucharstrie - .data; +fn long_branch() { + let trie_data = + toml::from_str::(include_str!("data/char16trie/test_long_branch.toml")) + .unwrap() + .ucharstrie + .data; let trie = Char16Trie::new(ZeroVec::from_slice_or_alloc(trie_data.as_slice())); for (query, expected) in [ @@ -216,8 +217,8 @@ fn char16trie_test_long_branch() { } #[test] -fn char16trie_test_compact() { - let trie_data = toml::from_str::(include_str!("testdata/test_compact.toml")) +fn compact() { + let trie_data = toml::from_str::(include_str!("data/char16trie/test_compact.toml")) .unwrap() .ucharstrie .data; @@ -258,8 +259,8 @@ fn char16trie_test_compact() { } #[test] -fn char16trie_test_months() { - let trie_data = toml::from_str::(include_str!("testdata/months.toml")) +fn months() { + let trie_data = toml::from_str::(include_str!("data/char16trie/months.toml")) .unwrap() .ucharstrie .data; @@ -291,3 +292,13 @@ fn char16trie_test_months() { let res = iter.next('h'); assert_eq!(res, TrieResult::NoMatch); } + +#[derive(serde::Deserialize)] +pub struct TestFile { + ucharstrie: Char16TrieVec, +} + +#[derive(serde::Deserialize)] +pub struct Char16TrieVec { + data: Vec, +} diff --git a/components/collections/src/codepointtrie/tests/test_util.rs b/components/collections/tests/cpt.rs similarity index 59% rename from components/collections/src/codepointtrie/tests/test_util.rs rename to components/collections/tests/cpt.rs index 7a7a97925e6..6ca035b7bbb 100644 --- a/components/collections/src/codepointtrie/tests/test_util.rs +++ b/components/collections/tests/cpt.rs @@ -2,19 +2,237 @@ // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). -use icu_collections::codepointtrie::error::Error; +use icu_collections::codepointtrie::planes::get_planes_trie; +use icu_collections::codepointtrie::Error; use icu_collections::codepointtrie::*; - -use core::convert::TryFrom; -#[cfg(feature = "serde")] -use serde::{Deserialize, Serialize}; -use std::path::Path; use zerovec::ZeroVec; +#[test] +fn planes_trie_deserialize_check_test() { + // Get expected planes trie from crate::planes::get_planes_trie() + + let exp_planes_trie = get_planes_trie(); + + // Compute actual planes trie from planes.toml + + let planes_enum_prop = + ::toml::from_str::(include_str!("data/cpt/planes.toml")) + .unwrap(); + + let code_point_trie_struct = planes_enum_prop.code_point_trie.trie_struct; + + let trie_header = CodePointTrieHeader { + high_start: code_point_trie_struct.high_start, + shifted12_high_start: code_point_trie_struct.shifted12_high_start, + index3_null_offset: code_point_trie_struct.index3_null_offset, + data_null_offset: code_point_trie_struct.data_null_offset, + null_value: code_point_trie_struct.null_value, + trie_type: TrieType::try_from(code_point_trie_struct.trie_type_enum_val).unwrap_or_else( + |_| { + panic!( + "Could not parse trie_type serialized enum value in test data file: {}", + code_point_trie_struct.name + ) + }, + ), + }; + + let data = ZeroVec::from_slice_or_alloc(code_point_trie_struct.data_8.as_ref().unwrap()); + let index = ZeroVec::from_slice_or_alloc(&code_point_trie_struct.index); + let trie_result: Result, Error> = + CodePointTrie::try_new(trie_header, index, data); + let act_planes_trie = trie_result.unwrap(); + + // Get check ranges (inversion map-style sequence of range+value) and + // apply the trie validation test fn on expected and actual tries + + let serialized_ranges: Vec<(u32, u32, u32)> = planes_enum_prop.code_point_map.data.ranges; + let mut check_ranges: Vec = vec![]; + for range_tuple in serialized_ranges { + let range_end = range_tuple.1 + 1; + let value = range_tuple.2; + check_ranges.push(range_end); + check_ranges.push(value); + } + + check_trie(&act_planes_trie, &check_ranges); + check_trie(&exp_planes_trie, &check_ranges); +} + +#[test] +fn free_blocks_16() { + run_deserialize_test_from_test_data(include_str!("data/cpt/free-blocks.16.toml")); +} + +#[test] +fn free_blocks_32() { + run_deserialize_test_from_test_data(include_str!("data/cpt/free-blocks.32.toml")); +} + +#[test] +fn free_blocks_8() { + run_deserialize_test_from_test_data(include_str!("data/cpt/free-blocks.8.toml")); +} + +#[test] +fn free_blocks_small16() { + run_deserialize_test_from_test_data(include_str!("data/cpt/free-blocks.small16.toml")); +} + +#[test] +fn grow_data_16() { + run_deserialize_test_from_test_data(include_str!("data/cpt/grow-data.16.toml")); +} + +#[test] +fn grow_data_32() { + run_deserialize_test_from_test_data(include_str!("data/cpt/grow-data.32.toml")); +} + +#[test] +fn grow_data_8() { + run_deserialize_test_from_test_data(include_str!("data/cpt/grow-data.8.toml")); +} + +#[test] +fn grow_data_small16() { + run_deserialize_test_from_test_data(include_str!("data/cpt/grow-data.small16.toml")); +} + +#[test] +fn set1_16() { + run_deserialize_test_from_test_data(include_str!("data/cpt/set1.16.toml")); +} + +#[test] +fn set1_32() { + run_deserialize_test_from_test_data(include_str!("data/cpt/set1.32.toml")); +} + +#[test] +fn set1_8() { + run_deserialize_test_from_test_data(include_str!("data/cpt/set1.8.toml")); +} + +#[test] +fn set1_small16() { + run_deserialize_test_from_test_data(include_str!("data/cpt/set1.small16.toml")); +} + +#[test] +fn set2_overlap_16() { + run_deserialize_test_from_test_data(include_str!("data/cpt/set2-overlap.16.toml")); +} + +#[test] +fn set2_overlap_32() { + run_deserialize_test_from_test_data(include_str!("data/cpt/set2-overlap.32.toml")); +} + +#[test] +fn set2_overlap_small16() { + run_deserialize_test_from_test_data(include_str!("data/cpt/set2-overlap.small16.toml")); +} + +#[test] +fn set3_initial_9_16() { + run_deserialize_test_from_test_data(include_str!("data/cpt/set3-initial-9.16.toml")); +} + +#[test] +fn set3_initial_9_32() { + run_deserialize_test_from_test_data(include_str!("data/cpt/set3-initial-9.32.toml")); +} + +#[test] +fn set3_initial_9_8() { + run_deserialize_test_from_test_data(include_str!("data/cpt/set3-initial-9.8.toml")); +} + +#[test] +fn set3_initial_9_small16() { + run_deserialize_test_from_test_data(include_str!("data/cpt/set3-initial-9.small16.toml")); +} + +#[test] +fn set_empty_16() { + run_deserialize_test_from_test_data(include_str!("data/cpt/set-empty.16.toml")); +} + +#[test] +fn set_empty_32() { + run_deserialize_test_from_test_data(include_str!("data/cpt/set-empty.32.toml")); +} + +#[test] +fn set_empty_8() { + run_deserialize_test_from_test_data(include_str!("data/cpt/set-empty.8.toml")); +} + +#[test] +fn set_empty_small16() { + run_deserialize_test_from_test_data(include_str!("data/cpt/set-empty.small16.toml")); +} + +#[test] +fn set_single_value_16() { + run_deserialize_test_from_test_data(include_str!("data/cpt/set-single-value.16.toml")); +} + +#[test] +fn set_single_value_32() { + run_deserialize_test_from_test_data(include_str!("data/cpt/set-single-value.32.toml")); +} + +#[test] +fn set_single_value_8() { + run_deserialize_test_from_test_data(include_str!("data/cpt/set-single-value.8.toml")); +} + +#[test] +fn set_single_value_small16() { + run_deserialize_test_from_test_data(include_str!("data/cpt/set-single-value.small16.toml")); +} + +#[test] +fn short_all_same_16() { + run_deserialize_test_from_test_data(include_str!("data/cpt/short-all-same.16.toml")); +} + +#[test] +fn short_all_same_8() { + run_deserialize_test_from_test_data(include_str!("data/cpt/short-all-same.8.toml")); +} + +#[test] +fn short_all_same_small16() { + run_deserialize_test_from_test_data(include_str!("data/cpt/short-all-same.small16.toml")); +} + +#[test] +fn small0_in_fast_16() { + run_deserialize_test_from_test_data(include_str!("data/cpt/small0-in-fast.16.toml")); +} + +#[test] +fn small0_in_fast_32() { + run_deserialize_test_from_test_data(include_str!("data/cpt/small0-in-fast.32.toml")); +} + +#[test] +fn small0_in_fast_8() { + run_deserialize_test_from_test_data(include_str!("data/cpt/small0-in-fast.8.toml")); +} + +#[test] +fn small0_in_fast_small16() { + run_deserialize_test_from_test_data(include_str!("data/cpt/small0-in-fast.small16.toml")); +} + /// The width of the elements in the data array of a [`CodePointTrie`]. /// See [`UCPTrieValueWidth`](https://unicode-org.github.io/icu-docs/apidoc/dev/icu4c/ucptrie_8h.html) in ICU4C. #[derive(Clone, Copy, PartialEq)] -#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum ValueWidthEnum { Bits16 = 0, Bits32 = 1, @@ -39,7 +257,7 @@ pub fn check_trie>(trie: &CodePointTrie, check_range let range_value = range_tuple[1]; // Check all values in this range, one-by-one while i < range_limit { - assert_eq!(range_value, trie.get32(i), "trie_get({})", i,); + assert_eq!(range_value, trie.get32(i).into(), "trie_get({})", i,); i += 1; } } @@ -87,7 +305,7 @@ pub fn test_check_ranges_get_ranges>( range_start = range_limit; } - assert!(trie_ranges.next() == None, "CodePointTrie iter_ranges() produces more ranges than the check_ranges field in testdata has"); + assert!(trie_ranges.next().is_none(), "CodePointTrie iter_ranges() produces more ranges than the check_ranges field in testdata has"); } /// Run above tests that verify the validity of CodePointTrie methods @@ -191,10 +409,9 @@ pub fn run_deserialize_test_from_test_data(test_file: &str) { check_ranges: Vec, } - let test_struct = toml::from_str::(&test_file) - .unwrap() - .code_point_trie - .trie_struct; + let test_file = ::toml::from_str::(test_file).unwrap(); + + let test_struct = test_file.code_point_trie.trie_struct; println!( "Running CodePointTrie reader logic test on test data file: {}", diff --git a/components/collections/src/char16trie/tests/testdata/empty.toml b/components/collections/tests/data/char16trie/empty.toml similarity index 100% rename from components/collections/src/char16trie/tests/testdata/empty.toml rename to components/collections/tests/data/char16trie/empty.toml diff --git a/components/collections/src/char16trie/tests/testdata/months.toml b/components/collections/tests/data/char16trie/months.toml similarity index 100% rename from components/collections/src/char16trie/tests/testdata/months.toml rename to components/collections/tests/data/char16trie/months.toml diff --git a/components/collections/src/char16trie/tests/testdata/test_a.toml b/components/collections/tests/data/char16trie/test_a.toml similarity index 100% rename from components/collections/src/char16trie/tests/testdata/test_a.toml rename to components/collections/tests/data/char16trie/test_a.toml diff --git a/components/collections/src/char16trie/tests/testdata/test_a_ab.toml b/components/collections/tests/data/char16trie/test_a_ab.toml similarity index 100% rename from components/collections/src/char16trie/tests/testdata/test_a_ab.toml rename to components/collections/tests/data/char16trie/test_a_ab.toml diff --git a/components/collections/src/char16trie/tests/testdata/test_branches.toml b/components/collections/tests/data/char16trie/test_branches.toml similarity index 100% rename from components/collections/src/char16trie/tests/testdata/test_branches.toml rename to components/collections/tests/data/char16trie/test_branches.toml diff --git a/components/collections/src/char16trie/tests/testdata/test_compact.toml b/components/collections/tests/data/char16trie/test_compact.toml similarity index 100% rename from components/collections/src/char16trie/tests/testdata/test_compact.toml rename to components/collections/tests/data/char16trie/test_compact.toml diff --git a/components/collections/src/char16trie/tests/testdata/test_long_branch.toml b/components/collections/tests/data/char16trie/test_long_branch.toml similarity index 100% rename from components/collections/src/char16trie/tests/testdata/test_long_branch.toml rename to components/collections/tests/data/char16trie/test_long_branch.toml diff --git a/components/collections/src/char16trie/tests/testdata/test_long_sequence.toml b/components/collections/tests/data/char16trie/test_long_sequence.toml similarity index 100% rename from components/collections/src/char16trie/tests/testdata/test_long_sequence.toml rename to components/collections/tests/data/char16trie/test_long_sequence.toml diff --git a/components/collections/src/char16trie/tests/testdata/test_shortest_branch.toml b/components/collections/tests/data/char16trie/test_shortest_branch.toml similarity index 100% rename from components/collections/src/char16trie/tests/testdata/test_shortest_branch.toml rename to components/collections/tests/data/char16trie/test_shortest_branch.toml diff --git a/components/collections/src/codepointtrie/tests/testdata/free-blocks.16.toml b/components/collections/tests/data/cpt/free-blocks.16.toml similarity index 100% rename from components/collections/src/codepointtrie/tests/testdata/free-blocks.16.toml rename to components/collections/tests/data/cpt/free-blocks.16.toml diff --git a/components/collections/src/codepointtrie/tests/testdata/free-blocks.32.toml b/components/collections/tests/data/cpt/free-blocks.32.toml similarity index 100% rename from components/collections/src/codepointtrie/tests/testdata/free-blocks.32.toml rename to components/collections/tests/data/cpt/free-blocks.32.toml diff --git a/components/collections/src/codepointtrie/tests/testdata/free-blocks.8.toml b/components/collections/tests/data/cpt/free-blocks.8.toml similarity index 100% rename from components/collections/src/codepointtrie/tests/testdata/free-blocks.8.toml rename to components/collections/tests/data/cpt/free-blocks.8.toml diff --git a/components/collections/src/codepointtrie/tests/testdata/free-blocks.small16.toml b/components/collections/tests/data/cpt/free-blocks.small16.toml similarity index 100% rename from components/collections/src/codepointtrie/tests/testdata/free-blocks.small16.toml rename to components/collections/tests/data/cpt/free-blocks.small16.toml diff --git a/components/collections/src/codepointtrie/tests/testdata/grow-data.16.toml b/components/collections/tests/data/cpt/grow-data.16.toml similarity index 100% rename from components/collections/src/codepointtrie/tests/testdata/grow-data.16.toml rename to components/collections/tests/data/cpt/grow-data.16.toml diff --git a/components/collections/src/codepointtrie/tests/testdata/grow-data.32.toml b/components/collections/tests/data/cpt/grow-data.32.toml similarity index 100% rename from components/collections/src/codepointtrie/tests/testdata/grow-data.32.toml rename to components/collections/tests/data/cpt/grow-data.32.toml diff --git a/components/collections/src/codepointtrie/tests/testdata/grow-data.8.toml b/components/collections/tests/data/cpt/grow-data.8.toml similarity index 100% rename from components/collections/src/codepointtrie/tests/testdata/grow-data.8.toml rename to components/collections/tests/data/cpt/grow-data.8.toml diff --git a/components/collections/src/codepointtrie/tests/testdata/grow-data.small16.toml b/components/collections/tests/data/cpt/grow-data.small16.toml similarity index 100% rename from components/collections/src/codepointtrie/tests/testdata/grow-data.small16.toml rename to components/collections/tests/data/cpt/grow-data.small16.toml diff --git a/components/collections/src/codepointtrie/tests/testdata/planes.toml b/components/collections/tests/data/cpt/planes.toml similarity index 100% rename from components/collections/src/codepointtrie/tests/testdata/planes.toml rename to components/collections/tests/data/cpt/planes.toml diff --git a/components/collections/src/codepointtrie/tests/testdata/set-empty.16.toml b/components/collections/tests/data/cpt/set-empty.16.toml similarity index 100% rename from components/collections/src/codepointtrie/tests/testdata/set-empty.16.toml rename to components/collections/tests/data/cpt/set-empty.16.toml diff --git a/components/collections/src/codepointtrie/tests/testdata/set-empty.32.toml b/components/collections/tests/data/cpt/set-empty.32.toml similarity index 100% rename from components/collections/src/codepointtrie/tests/testdata/set-empty.32.toml rename to components/collections/tests/data/cpt/set-empty.32.toml diff --git a/components/collections/src/codepointtrie/tests/testdata/set-empty.8.toml b/components/collections/tests/data/cpt/set-empty.8.toml similarity index 100% rename from components/collections/src/codepointtrie/tests/testdata/set-empty.8.toml rename to components/collections/tests/data/cpt/set-empty.8.toml diff --git a/components/collections/src/codepointtrie/tests/testdata/set-empty.small16.toml b/components/collections/tests/data/cpt/set-empty.small16.toml similarity index 100% rename from components/collections/src/codepointtrie/tests/testdata/set-empty.small16.toml rename to components/collections/tests/data/cpt/set-empty.small16.toml diff --git a/components/collections/src/codepointtrie/tests/testdata/set-single-value.16.toml b/components/collections/tests/data/cpt/set-single-value.16.toml similarity index 100% rename from components/collections/src/codepointtrie/tests/testdata/set-single-value.16.toml rename to components/collections/tests/data/cpt/set-single-value.16.toml diff --git a/components/collections/src/codepointtrie/tests/testdata/set-single-value.32.toml b/components/collections/tests/data/cpt/set-single-value.32.toml similarity index 100% rename from components/collections/src/codepointtrie/tests/testdata/set-single-value.32.toml rename to components/collections/tests/data/cpt/set-single-value.32.toml diff --git a/components/collections/src/codepointtrie/tests/testdata/set-single-value.8.toml b/components/collections/tests/data/cpt/set-single-value.8.toml similarity index 100% rename from components/collections/src/codepointtrie/tests/testdata/set-single-value.8.toml rename to components/collections/tests/data/cpt/set-single-value.8.toml diff --git a/components/collections/src/codepointtrie/tests/testdata/set-single-value.small16.toml b/components/collections/tests/data/cpt/set-single-value.small16.toml similarity index 100% rename from components/collections/src/codepointtrie/tests/testdata/set-single-value.small16.toml rename to components/collections/tests/data/cpt/set-single-value.small16.toml diff --git a/components/collections/src/codepointtrie/tests/testdata/set1.16.toml b/components/collections/tests/data/cpt/set1.16.toml similarity index 100% rename from components/collections/src/codepointtrie/tests/testdata/set1.16.toml rename to components/collections/tests/data/cpt/set1.16.toml diff --git a/components/collections/src/codepointtrie/tests/testdata/set1.32.toml b/components/collections/tests/data/cpt/set1.32.toml similarity index 100% rename from components/collections/src/codepointtrie/tests/testdata/set1.32.toml rename to components/collections/tests/data/cpt/set1.32.toml diff --git a/components/collections/src/codepointtrie/tests/testdata/set1.8.toml b/components/collections/tests/data/cpt/set1.8.toml similarity index 100% rename from components/collections/src/codepointtrie/tests/testdata/set1.8.toml rename to components/collections/tests/data/cpt/set1.8.toml diff --git a/components/collections/src/codepointtrie/tests/testdata/set1.small16.toml b/components/collections/tests/data/cpt/set1.small16.toml similarity index 100% rename from components/collections/src/codepointtrie/tests/testdata/set1.small16.toml rename to components/collections/tests/data/cpt/set1.small16.toml diff --git a/components/collections/src/codepointtrie/tests/testdata/set2-overlap.16.toml b/components/collections/tests/data/cpt/set2-overlap.16.toml similarity index 100% rename from components/collections/src/codepointtrie/tests/testdata/set2-overlap.16.toml rename to components/collections/tests/data/cpt/set2-overlap.16.toml diff --git a/components/collections/src/codepointtrie/tests/testdata/set2-overlap.32.toml b/components/collections/tests/data/cpt/set2-overlap.32.toml similarity index 100% rename from components/collections/src/codepointtrie/tests/testdata/set2-overlap.32.toml rename to components/collections/tests/data/cpt/set2-overlap.32.toml diff --git a/components/collections/src/codepointtrie/tests/testdata/set2-overlap.small16.toml b/components/collections/tests/data/cpt/set2-overlap.small16.toml similarity index 100% rename from components/collections/src/codepointtrie/tests/testdata/set2-overlap.small16.toml rename to components/collections/tests/data/cpt/set2-overlap.small16.toml diff --git a/components/collections/src/codepointtrie/tests/testdata/set3-initial-9.16.toml b/components/collections/tests/data/cpt/set3-initial-9.16.toml similarity index 100% rename from components/collections/src/codepointtrie/tests/testdata/set3-initial-9.16.toml rename to components/collections/tests/data/cpt/set3-initial-9.16.toml diff --git a/components/collections/src/codepointtrie/tests/testdata/set3-initial-9.32.toml b/components/collections/tests/data/cpt/set3-initial-9.32.toml similarity index 100% rename from components/collections/src/codepointtrie/tests/testdata/set3-initial-9.32.toml rename to components/collections/tests/data/cpt/set3-initial-9.32.toml diff --git a/components/collections/src/codepointtrie/tests/testdata/set3-initial-9.8.toml b/components/collections/tests/data/cpt/set3-initial-9.8.toml similarity index 100% rename from components/collections/src/codepointtrie/tests/testdata/set3-initial-9.8.toml rename to components/collections/tests/data/cpt/set3-initial-9.8.toml diff --git a/components/collections/src/codepointtrie/tests/testdata/set3-initial-9.small16.toml b/components/collections/tests/data/cpt/set3-initial-9.small16.toml similarity index 100% rename from components/collections/src/codepointtrie/tests/testdata/set3-initial-9.small16.toml rename to components/collections/tests/data/cpt/set3-initial-9.small16.toml diff --git a/components/collections/src/codepointtrie/tests/testdata/short-all-same.16.toml b/components/collections/tests/data/cpt/short-all-same.16.toml similarity index 100% rename from components/collections/src/codepointtrie/tests/testdata/short-all-same.16.toml rename to components/collections/tests/data/cpt/short-all-same.16.toml diff --git a/components/collections/src/codepointtrie/tests/testdata/short-all-same.8.toml b/components/collections/tests/data/cpt/short-all-same.8.toml similarity index 100% rename from components/collections/src/codepointtrie/tests/testdata/short-all-same.8.toml rename to components/collections/tests/data/cpt/short-all-same.8.toml diff --git a/components/collections/src/codepointtrie/tests/testdata/short-all-same.small16.toml b/components/collections/tests/data/cpt/short-all-same.small16.toml similarity index 100% rename from components/collections/src/codepointtrie/tests/testdata/short-all-same.small16.toml rename to components/collections/tests/data/cpt/short-all-same.small16.toml diff --git a/components/collections/src/codepointtrie/tests/testdata/small0-in-fast.16.toml b/components/collections/tests/data/cpt/small0-in-fast.16.toml similarity index 100% rename from components/collections/src/codepointtrie/tests/testdata/small0-in-fast.16.toml rename to components/collections/tests/data/cpt/small0-in-fast.16.toml diff --git a/components/collections/src/codepointtrie/tests/testdata/small0-in-fast.32.toml b/components/collections/tests/data/cpt/small0-in-fast.32.toml similarity index 100% rename from components/collections/src/codepointtrie/tests/testdata/small0-in-fast.32.toml rename to components/collections/tests/data/cpt/small0-in-fast.32.toml diff --git a/components/collections/src/codepointtrie/tests/testdata/small0-in-fast.8.toml b/components/collections/tests/data/cpt/small0-in-fast.8.toml similarity index 100% rename from components/collections/src/codepointtrie/tests/testdata/small0-in-fast.8.toml rename to components/collections/tests/data/cpt/small0-in-fast.8.toml diff --git a/components/collections/src/codepointtrie/tests/testdata/small0-in-fast.small16.toml b/components/collections/tests/data/cpt/small0-in-fast.small16.toml similarity index 100% rename from components/collections/src/codepointtrie/tests/testdata/small0-in-fast.small16.toml rename to components/collections/tests/data/cpt/small0-in-fast.small16.toml