Test Details

These test details are for v0.3 of SuperPermsTest. To the newest version. To the previous version

This is a description of all the tests that get executed, and why they are done. The "->" is a short form for me to say "parent of" for SuperPerms.

Test 1

Do all SuperPerms in a hierarchies default to "false", if the parent of them is by default "false" and none of them is specified in the permissions plugin?

Details: A hierarchy of 4 nodes "layer11 -> layer21 -> layer31 -> layer41" is defined. The player has none of these permission nodes assigned in the permissions plugin. The expected result is that the player has none of the four permissions.

Test 2

Do all SuperPerms in a hierarchies return true, if all of them are explicitely set to true in the permissions plugin?

Details: A hierarchy of 4 nodes "layer12 -> layer22 -> layer32 -> layer42" is defined. The player has all of these permission nodes assigned in the permissions plugin. The expected result is that the player has all four permissions.

Test 3

Do all SuperPerms in a hierarchies return true, if only the parent is set to true in the permissions plugin?

Details: A hierarchy of 4 nodes "layer13 -> layer23 -> layer33 -> layer43" is defined. The player only has "layer13" assigned. The expected result is that the player has all four permissions.

Test 4

Do all SuperPerms in a sub-hierarchy return true, if a child is set to true in the permissions plugin?

Details: A hierarchy of 4 nodes "layer14 -> layer24 -> layer34 -> layer44" is defined. The player only has "layer24" assigned. The expected result is that the player has only permissions "layer24", "layer34" and "layer44".

Test 5

Do all SuperPerms in a sub-sub-hierarchy return true, if the child of a child is set to true in the permissions plugin?

Details: A hierarchy of 4 nodes "layer15 -> layer25 -> layer35 -> layer45" is defined. The player only has "layer35" assigned. The expected result is that the player has only permissions "layer35" and "layer45".

Test 6

Do the lowest node of a hierarchy return true, if only it is set to true in the permissions plugin?

Details: A hierarchy of 4 nodes "layer16 -> layer26 -> layer36 -> layer46" is defined. The player only has "layer46" assigned. The expected result is that the player has only permission "layer46".

Test 7

Does explicitely negating the child of an assigned parent node work as expected?

Details: A hierarchy of 4 nodes "layer17 -> layer27 -> layer37 -> layer47" is defined. The player has "layer17" assigned, and "layer27" explicitely not assigned (set to false). The expected result is that the player has only permission "layer17".

Test 8

Does assigning a child node of an explicitely negated child of an assigned parent node work as expected? (negation of negation)

Details: A hierarchy of 4 nodes "layer18 -> layer28 -> layer38 -> layer48" is defined. The player has "layer18" assigned, and "layer28" explicitely not assigned (set to false) and "layer38" assigned. The expected result is that the player has only permissions "layer18", "layer38" and "layer48", but not "layer28".

Test 9

Get the default values "true" and "false" for permission nodes respected?

Details: Two nodes "single1" (default value true) and "single2" (default value false) are defined. None of them is assigned or explicitely not assigned in the permission plugin. The expected result is that the player has only permissions "single1", but not "single2".

Test 10

Are hierarchies respected and NOT based on permission node names?

Details: A hierarchy of two nodes "str1 -> str1.c1" is created, alongside a single, unrelated node called "str1.c2". The player gets the node "str1" assigned in the permission plugin. The expected result is that the player has only permissions "str1" and "str1.c1", but not "str1.c2", because that node isn't a child of "str1", despite looking like one.

Test 11

How are nodes that end with ".*" treated?

Details: A hierarchy of two nodes "str2.* -> str2.c1" is created, alongside two single, unrelated nodes called "str2" and "str2.c2". The player gets the node "str2.*" assigned in the permission plugin.

This test has two expected results:

  • SuperPerms take precedence: The player has only permissions "str2.*" and "str2.c1"
  • It is treated as a wildcard: The player has only permissions "str2.*", "str2.c1" and "str2.c2"

Test 12

Are nodes ending with ".*" considered nothing special?

Details: A hierarchy of two nodes "str3 -> c1.str3" is created, alongside a single, unrelated node called "str3.*". The player gets the node "str3.*" assigned in the permission plugin.

The expected result is, independent of if treated as a wildcard or not: The player has only permissions "str3.*"

Test 13

Are nodes that are defined in uppercase considered when asking for lowercase?

Details: A single superperms node "Case1" is defined and set to true by default. The expected result of checking the permission "case1" is "true".

Test 14

Are attachments possible?

Details: A permission attachment of one new node "attach1" is attached to the player. Checking this node later should return "true".