File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 1+ import { wrapAround , containsOnlyLettersAndUnderscores , replaceIllegalFileNameCharactersInString } from '../utils/Utils' ;
2+
3+ test ( 'If wrapAround wraps correctly' , ( ) => {
4+ expect ( wrapAround ( 100 , 5 ) ) . toBe ( 0 ) ;
5+ expect ( wrapAround ( 100 , 7 ) ) . toBe ( 2 ) ;
6+ } ) ;
7+
8+ test ( 'If wrapAround errors out when dividing by zero' , ( ) => {
9+ expect ( wrapAround ( 100 , 0 ) ) . toThrow ( ) ;
10+ } ) ;
11+
12+ test ( 'Letter and underscore string validity' , ( ) => {
13+ expect ( containsOnlyLettersAndUnderscores ( "asdkfj_" ) ) . toBe ( true ) ;
14+ expect ( containsOnlyLettersAndUnderscores ( "asdkfj0" ) ) . toBe ( false ) ;
15+ } ) ;
16+
17+ test ( 'Letter and underscore unicode char test' , ( ) => {
18+ expect ( containsOnlyLettersAndUnderscores ( "asdkaÈj" ) ) . toBe ( true ) ;
19+ expect ( containsOnlyLettersAndUnderscores ( "asdkaÈj0" ) ) . toBe ( false ) ;
20+ } ) ;
21+
22+ test ( 'Valid filename test' , ( ) => {
23+ expect ( replaceIllegalFileNameCharactersInString ( "what?is\\this:" ) ) . toBe ( "whatisthis -" ) ;
24+ } )
You can’t perform that action at this time.
0 commit comments