@@ -79,7 +79,7 @@ fn test_potential_mixed_script_detection() {
79
79
}
80
80
81
81
#[ test]
82
- fn test_augmented_script_set ( ) {
82
+ fn test_augmented_script_set_fmt_debug ( ) {
83
83
use crate :: mixed_script:: AugmentedScriptSet ;
84
84
let augmented_script_sets = vec ! [
85
85
AugmentedScriptSet :: default ( ) ,
@@ -114,3 +114,40 @@ fn test_augmented_script_set() {
114
114
assert_eq ! ( format!( "{:?}" , ss) , output) ;
115
115
}
116
116
}
117
+
118
+ #[ test]
119
+ fn test_augmented_script_set_fmt_display ( ) {
120
+ use crate :: mixed_script:: AugmentedScriptSet ;
121
+ let augmented_script_sets = vec ! [
122
+ AugmentedScriptSet :: default ( ) ,
123
+ AugmentedScriptSet :: from( '0' ) ,
124
+ AugmentedScriptSet :: from( 'a' ) ,
125
+ AugmentedScriptSet :: from( 'μ' ) ,
126
+ AugmentedScriptSet :: from( '汉' ) ,
127
+ AugmentedScriptSet :: from( 'ひ' ) ,
128
+ AugmentedScriptSet :: from( 'カ' ) ,
129
+ AugmentedScriptSet :: from( '한' ) ,
130
+ AugmentedScriptSet :: from( "汉ひ" ) ,
131
+ AugmentedScriptSet :: from( "汉a" ) ,
132
+ AugmentedScriptSet :: from( "汉μ" ) ,
133
+ AugmentedScriptSet :: from( "〆切" ) ,
134
+ ] ;
135
+ let debug_output = vec ! [
136
+ "All" ,
137
+ "All" ,
138
+ "Latin" ,
139
+ "Greek" ,
140
+ "Han with Bopomofo, Japanese, Korean, Han" ,
141
+ "Japanese, Hiragana" ,
142
+ "Japanese, Katakana" ,
143
+ "Korean, Hangul" ,
144
+ "Japanese" ,
145
+ "Empty" ,
146
+ "Empty" ,
147
+ "Han with Bopomofo, Japanese, Korean, Han" ,
148
+ ] ;
149
+
150
+ for ( ss, output) in augmented_script_sets. into_iter ( ) . zip ( debug_output) {
151
+ assert_eq ! ( format!( "{}" , ss) , output) ;
152
+ }
153
+ }
0 commit comments