Skip to content

Commit

Permalink
Added test for symbolicToIntegerAccessRights
Browse files Browse the repository at this point in the history
Signed-off-by: Philip R. Kensche <p.kensche@dkfz-heidelberg.de>
  • Loading branch information
vinjana committed May 21, 2024
1 parent 7b7e57c commit 65d0f12
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/test/groovy/de/dkfz/roddy/RoddyIOHelperMethodsTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,25 @@ public class RoddyIOHelperMethodsTest {
}
}

@Test
public void testSymbolicToIntegerAccessRights() throws Exception {
Map<String, Integer> valuesAndExpectedMap = [
"u=rwx,g=rwx,o=rwx": 0777, //rwx,rwx,rwx
"u=rwx,g=rwx,o-rwx": 0770, //rwx,rwx,---
"u+rwx,g+rwx,o-rwx": 0770, //rwx,rwx,---
"u+rw,g-rw,o-rwx" : 0710, //rwx,---,---
"u+rw,g+rw,o-rwx" : 0770, //rwx,rw-,---
"u+rw,g+rw" : 0775, //rwx,rw-,r--
"u-w,g+rw,u-r" : 0175, //--x,rwx,r-x Careful here, u ist set two times!
]

valuesAndExpectedMap.each {
String rights, Integer res ->
assert res == RoddyIOHelperMethods.symbolicToIntegerAccessRights(rights, 0022)
}

}

@Test
public void testConvertUMaskToAccessRights() throws Exception {
Map<String, String> valuesAndResults = [
Expand Down

0 comments on commit 65d0f12

Please sign in to comment.