File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,3 +16,40 @@ pub const SYM_TEE_RIGHT: &str = "┣";
1616pub const SYM_TEE_UP : & str = "┻" ;
1717pub const SYM_TEE_DOWN : & str = "┳" ;
1818pub const SYM_SPACE : & str = " " ;
19+
20+ #[ cfg( test) ]
21+ mod tests {
22+ use super :: * ;
23+
24+ #[ test]
25+ fn symbols_are_single_char_and_distinct ( ) {
26+ let symbols = [
27+ SYM_COMMIT ,
28+ SYM_COMMIT_BRANCH ,
29+ SYM_COMMIT_MERGE ,
30+ SYM_COMMIT_STASH ,
31+ SYM_COMMIT_UNCOMMITTED ,
32+ SYM_VERTICAL ,
33+ SYM_VERTICAL_DOTTED ,
34+ SYM_HORIZONTAL ,
35+ SYM_MERGE_BRIDGE_START ,
36+ SYM_MERGE_BRIDGE_MID ,
37+ SYM_MERGE_BRIDGE_END ,
38+ SYM_BRANCH_UP ,
39+ SYM_BRANCH_UP_RIGHT ,
40+ SYM_TEE_LEFT ,
41+ SYM_TEE_RIGHT ,
42+ SYM_TEE_UP ,
43+ SYM_TEE_DOWN ,
44+ SYM_SPACE ,
45+ ] ;
46+
47+ for symbol in symbols {
48+ assert_eq ! (
49+ symbol. chars( ) . count( ) ,
50+ 1 ,
51+ "{symbol:?} should be a single glyph"
52+ ) ;
53+ }
54+ }
55+ }
You can’t perform that action at this time.
0 commit comments