Clean-up after merge
This commit is contained in:
parent
391915eb09
commit
da16b2af6a
15 changed files with 177 additions and 171 deletions
|
|
@ -1,24 +1,29 @@
|
|||
import { wrapAround, containsOnlyLettersAndUnderscores, replaceIllegalFileNameCharactersInString} from '../utils/Utils';
|
||||
import {containsOnlyLettersAndUnderscores, replaceIllegalFileNameCharactersInString, wrapAround} from '../utils/Utils';
|
||||
|
||||
test('If wrapAround wraps correctly', () => {
|
||||
expect(wrapAround(100,5)).toBe(0);
|
||||
expect(wrapAround(100,7)).toBe(2);
|
||||
expect(wrapAround(100, 5)).toBe(0);
|
||||
expect(wrapAround(100, 7)).toBe(2);
|
||||
});
|
||||
|
||||
test('If wrapAround errors out when dividing by zero', () => {
|
||||
expect(wrapAround(100,0)).toThrow();
|
||||
expect(wrapAround(100, 0)).toThrow();
|
||||
});
|
||||
|
||||
test('If wrapAround errors out when size is negative', () => {
|
||||
expect(wrapAround(100, -5)).toThrow();
|
||||
});
|
||||
|
||||
test('Letter and underscore string validity', () => {
|
||||
expect(containsOnlyLettersAndUnderscores("asdkfj_")).toBe(true);
|
||||
expect(containsOnlyLettersAndUnderscores("asdkfj0")).toBe(false);
|
||||
expect(containsOnlyLettersAndUnderscores('asdkfj_')).toBe(true);
|
||||
expect(containsOnlyLettersAndUnderscores('asdkfj0')).toBe(false);
|
||||
});
|
||||
|
||||
test('Letter and underscore unicode char test', () =>{
|
||||
expect(containsOnlyLettersAndUnderscores("asdkaÈj")).toBe(true);
|
||||
expect(containsOnlyLettersAndUnderscores("asdkaÈj0")).toBe(false);
|
||||
// since this is used to check if a string is a valid name for an object property, unicode characters shouldn't be allowed, thus the name of the function is misleading
|
||||
test('Letter and underscore unicode char test', () => {
|
||||
expect(containsOnlyLettersAndUnderscores('asdkaÈj')).toBe(true);
|
||||
expect(containsOnlyLettersAndUnderscores('asdkaÈj0')).toBe(false);
|
||||
});
|
||||
|
||||
test('Valid filename test', ()=>{
|
||||
expect(replaceIllegalFileNameCharactersInString("what?is\\this:")).toBe("whatisthis -");
|
||||
})
|
||||
test('Valid filename test', () => {
|
||||
expect(replaceIllegalFileNameCharactersInString('what?is\\this:')).toBe('whatisthis -');
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue