@@ -77,3 +77,40 @@ fn test_potential_mixed_script_detection() {
77
77
assert ! ( is_potential_mixed_script_confusable_char( 'A' ) ) ;
78
78
assert ! ( !is_potential_mixed_script_confusable_char( 'D' ) ) ;
79
79
}
80
+
81
+ #[ test]
82
+ fn test_augmented_script_set ( ) {
83
+ use crate :: mixed_script:: AugmentedScriptSet ;
84
+ let augmented_script_sets = vec ! [
85
+ AugmentedScriptSet :: default ( ) ,
86
+ AugmentedScriptSet :: from( '0' ) ,
87
+ AugmentedScriptSet :: from( 'a' ) ,
88
+ AugmentedScriptSet :: from( 'μ' ) ,
89
+ AugmentedScriptSet :: from( '汉' ) ,
90
+ AugmentedScriptSet :: from( 'ひ' ) ,
91
+ AugmentedScriptSet :: from( 'カ' ) ,
92
+ AugmentedScriptSet :: from( '한' ) ,
93
+ AugmentedScriptSet :: from( "汉ひ" ) ,
94
+ AugmentedScriptSet :: from( "汉a" ) ,
95
+ AugmentedScriptSet :: from( "汉μ" ) ,
96
+ AugmentedScriptSet :: from( "〆切" ) ,
97
+ ] ;
98
+ let debug_output = vec ! [
99
+ "AugmentedScriptSet{ALL}" ,
100
+ "AugmentedScriptSet{ALL}" ,
101
+ "AugmentedScriptSet{Latn}" ,
102
+ "AugmentedScriptSet{Grek}" ,
103
+ "AugmentedScriptSet{Hanb, Jpan, Kore, Hani}" ,
104
+ "AugmentedScriptSet{Jpan, Hira}" ,
105
+ "AugmentedScriptSet{Jpan, Kana}" ,
106
+ "AugmentedScriptSet{Kore, Hang}" ,
107
+ "AugmentedScriptSet{Jpan}" ,
108
+ "AugmentedScriptSet{∅}" ,
109
+ "AugmentedScriptSet{∅}" ,
110
+ "AugmentedScriptSet{Hanb, Jpan, Kore, Hani}" ,
111
+ ] ;
112
+
113
+ for ( ss, output) in augmented_script_sets. into_iter ( ) . zip ( debug_output) {
114
+ assert_eq ! ( format!( "{:?}" , ss) , output) ;
115
+ }
116
+ }
0 commit comments