use brf_macro::*; #[test] fn test_brf() { let val = brf!(" A1B'K2L@CIF/MSP\"E3H9O6R^DJG>NTQ,*5<-U8V.%[$+X!&;:4\\0Z7(_?W]#Y)="); let expected = "⠀⠁⠂⠃⠄⠅⠆⠇⠈⠉⠊⠋⠌⠍⠎⠏⠐⠑⠒⠓⠔⠕⠖⠗⠘⠙⠚⠛⠜⠝⠞⠟⠠⠡⠢⠣⠤⠥⠦⠧⠨⠩⠪⠫⠬⠭⠮⠯⠰⠱⠲⠳⠴⠵⠶⠷⠸⠹⠺⠻⠼⠽⠾⠿"; assert_eq!(val, expected); let tom_sawyer = brf!( r#" ,,! ,,ADV5TURES ,,( ,,TOM ,,SAWY] ,,BY ,,M>K ,,TWA9 7,SAMUEL ,LANGHORNE ,CLEM5S7 ;,P ;,R ;,E ;,F ,A ;,C ;,E ,,MO/ (! ADV5TURES RECORD$ 9 ? BOOK RE,Y O3URR$2 "O OR TWO 7 EXP]I;ES ( MY [N1 ! RE/ ^? ( BOYS :O 7 S*OOLMATES ( M9E4 ,HUCK ,F9N IS DRAWN F LIFE2 ,TOM ,SAWY] AL1 B N F AN 9DIVIDUAL--HE IS A -B9A- TION (! "*I/ICS ( ?REE BOYS :OM ,I KNEW1 & "!=E 2L;GS 6! -POSITE ORD] ( >*I- TECTURE4 ,! ODD SUP]/I;NS T\*$ ^U 7 ALL PREVA- L5T AM;G *N & SLAVES 9 ! ,WE/ AT ! P]IOD ( ? /ORY--T IS 6SAY1 ?IRTY OR =TY YE>S AGO4 ,AL? MY BOOK IS 9T5D$ MA9LY =! EN- T]TA9;T ( BOYS & GIRLS1 ,I HOPE X W N 2 %UNN$ 0M5 & WOM5 ON T A3.T1 = "P ( MY PLAN HAS BE5 6TRY 6PL1SANTLY REM9D ADULTS ( :AT !Y ONCE 7 !MVS1 &( H[ !Y FELT & ?"\ & TALK$1 & :AT QUE] 5T]PRISES !Y "S"TS 5GAG$ IN4 ,,! ,,AU?OR4 ,,H>T=D1 #AHGF4 ;,T ,O ;,M ;,S ,A ;,W ;,Y ;,E ;,R --------------------------------------#B "# ); let expected = r#"⠀⠀⠠⠠⠮⠀⠠⠠⠁⠙⠧⠢⠞⠥⠗⠑⠎⠀⠠⠠⠷⠀⠠⠠⠞⠕⠍⠀⠠⠠⠎⠁⠺⠽⠻⠀ ⠀⠀⠠⠠⠃⠽⠀ ⠀⠀⠠⠠⠍⠜⠅⠀⠠⠠⠞⠺⠁⠔⠀ ⠀⠀⠶⠠⠎⠁⠍⠥⠑⠇⠀⠠⠇⠁⠝⠛⠓⠕⠗⠝⠑⠀⠠⠉⠇⠑⠍⠢⠎⠶⠀⠀⠀ ⠀⠀⠰⠠⠏⠀⠰⠠⠗⠀⠰⠠⠑⠀⠰⠠⠋⠀⠠⠁⠀⠰⠠⠉⠀⠰⠠⠑⠀ ⠀⠀⠠⠠⠍⠕⠌⠀⠷⠮⠀⠁⠙⠧⠢⠞⠥⠗⠑⠎⠀⠗⠑⠉⠕⠗⠙⠫⠀⠔⠀⠹⠀⠃⠕⠕⠅ ⠗⠑⠠⠽⠀⠕⠒⠥⠗⠗⠫⠆⠀⠐⠕⠀⠕⠗⠀⠞⠺⠕⠀⠶⠀⠑⠭⠏⠻⠊⠰⠑⠎⠀⠷⠀⠍⠽ ⠪⠝⠂⠀⠮⠀⠗⠑⠌⠀⠘⠹⠀⠷⠀⠃⠕⠽⠎⠀⠱⠕⠀⠶⠀⠎⠡⠕⠕⠇⠍⠁⠞⠑⠎⠀⠷ ⠍⠔⠑⠲⠀⠠⠓⠥⠉⠅⠀⠠⠋⠔⠝⠀⠊⠎⠀⠙⠗⠁⠺⠝⠀⠋⠀⠇⠊⠋⠑⠆⠀⠠⠞⠕⠍ ⠠⠎⠁⠺⠽⠻⠀⠁⠇⠂⠀⠃⠀⠝⠀⠋⠀⠁⠝⠀⠔⠙⠊⠧⠊⠙⠥⠁⠇⠤⠤⠓⠑⠀⠊⠎⠀⠁ ⠤⠃⠔⠁⠤⠀⠞⠊⠕⠝⠀⠷⠮⠀⠐⠡⠊⠌⠊⠉⠎⠀⠷⠀⠹⠗⠑⠑⠀⠃⠕⠽⠎⠀⠱⠕⠍⠀⠠⠊ ⠅⠝⠑⠺⠂⠀⠯⠀⠐⠮⠿⠑⠀⠆⠇⠰⠛⠎⠀⠖⠮⠀⠤⠏⠕⠎⠊⠞⠑⠀⠕⠗⠙⠻⠀⠷⠀⠀⠀ ⠜⠡⠊⠤⠀⠞⠑⠉⠞⠥⠗⠑⠲⠀⠀ ⠀⠀⠠⠮⠀⠕⠙⠙⠀⠎⠥⠏⠻⠌⠊⠰⠝⠎⠀⠞⠳⠡⠫⠀⠘⠥⠀⠶⠀⠁⠇⠇⠀⠏⠗⠑⠧⠁⠤ ⠇⠢⠞⠀⠁⠍⠰⠛⠀⠡⠝⠀⠯⠀⠎⠇⠁⠧⠑⠎⠀⠔⠀⠮⠀⠠⠺⠑⠌⠀⠁⠞⠀⠮⠀⠏⠻⠊⠕⠙ ⠷⠀⠹⠀⠌⠕⠗⠽⠤⠤⠞⠀⠊⠎⠀⠖⠎⠁⠽⠂⠀⠹⠊⠗⠞⠽⠀⠕⠗⠀⠿⠞⠽⠀⠽⠑⠜⠎ ⠁⠛⠕⠲⠀⠀⠀ ⠀⠀⠠⠁⠇⠹⠀⠍⠽⠀⠃⠕⠕⠅⠀⠊⠎⠀⠔⠞⠢⠙⠫⠀⠍⠁⠔⠇⠽⠀⠿⠮⠀⠑⠝⠤ ⠞⠻⠞⠁⠔⠰⠞⠀⠷⠀⠃⠕⠽⠎⠀⠯⠀⠛⠊⠗⠇⠎⠂⠀⠠⠊⠀⠓⠕⠏⠑⠀⠭⠀⠺⠀⠝⠀⠆ ⠩⠥⠝⠝⠫⠀⠴⠍⠢⠀⠯⠀⠺⠕⠍⠢⠀⠕⠝⠀⠞⠀⠁⠒⠨⠞⠂⠀⠿⠀⠐⠏⠀⠷⠀⠍⠽ ⠏⠇⠁⠝⠀⠓⠁⠎⠀⠃⠑⠢⠀⠖⠞⠗⠽⠀⠖⠏⠇⠂⠎⠁⠝⠞⠇⠽⠀⠗⠑⠍⠔⠙⠀ ⠁⠙⠥⠇⠞⠎⠀⠷⠀⠱⠁⠞⠀⠮⠽⠀⠕⠝⠉⠑⠀⠶⠀⠮⠍⠧⠎⠂⠀⠯⠷⠀⠓⠪⠀⠮⠽ ⠋⠑⠇⠞⠀⠯⠀⠹⠐⠳⠀⠯⠀⠞⠁⠇⠅⠫⠂⠀⠯⠀⠱⠁⠞⠀⠟⠥⠑⠻⠀⠢⠞⠻⠏⠗⠊⠎⠑⠎ ⠮⠽⠀⠐⠎⠐⠞⠎⠀⠢⠛⠁⠛⠫⠀⠊⠝⠲⠀⠀⠀⠀ ⠀⠀⠠⠠⠮⠀⠠⠠⠁⠥⠹⠕⠗⠲⠀⠀ ⠀⠀⠠⠠⠓⠜⠞⠿⠙⠂⠀⠼⠁⠓⠛⠋⠲⠀ ⠀⠀⠰⠠⠞⠀⠠⠕⠀⠰⠠⠍⠀⠰⠠⠎⠀⠠⠁⠀⠰⠠⠺⠀⠰⠠⠽⠀⠰⠠⠑⠀⠰⠠⠗⠀⠀⠀⠀ ⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠼⠃ "#; assert_eq!(tom_sawyer, expected); } #[test] fn test_brf_bytes() { let val = brf_bytes!(" A1B'K2L@CIF/MSP\"E3H9O6R^DJG>NTQ,*5<-U8V.%[$+X!&;:4\\0Z7(_?W]#Y)="); let expected = &[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, ]; assert_eq!(val, expected); }