Amended regex pattern for permission string, taken the prefix options from: https://askubuntu.com/tags/files/info

This commit is contained in:
Art051
2023-08-13 00:09:33 +01:00
parent 02c3c031f4
commit 273101eb53
2 changed files with 10 additions and 2 deletions

View File

@@ -279,6 +279,14 @@ describe('chmod-calculator', () => {
describe('validateSymbolicInput', () => {
describe('validateOrder', () => {
it('should correctly validate the order of permissions', () => {
expect(checkSymbolicString('-rwxrwxrwx')).toBe('');
expect(checkSymbolicString('drwxrwxrwx')).toBe('');
expect(checkSymbolicString('lrwxrwxrwx')).toBe('');
expect(checkSymbolicString('brwxrwxrwx')).toBe('');
expect(checkSymbolicString('crwxrwxrwx')).toBe('');
expect(checkSymbolicString('srwxrwxrwx')).toBe('');
expect(checkSymbolicString('prwxrwxrwx')).toBe('');
expect(checkSymbolicString('rwxrwxrwx')).toBe('');
expect(checkSymbolicString('rw-r--r--')).toBe('');
expect(checkSymbolicString('r-xr-xr-x')).toBe('');