diff options
Diffstat (limited to 'lib/tests/misc.nix')
-rw-r--r-- | lib/tests/misc.nix | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/tests/misc.nix b/lib/tests/misc.nix index 8e0cf1f45bb60..ef4483219f7eb 100644 --- a/lib/tests/misc.nix +++ b/lib/tests/misc.nix @@ -327,6 +327,34 @@ runTests { expected = "Hello\\x20World"; }; + testToInt = testAllTrue [ + # Naive + (123 == toInt "123") + (0 == toInt "0") + # Whitespace Padding + (123 == toInt " 123") + (123 == toInt "123 ") + (123 == toInt " 123 ") + (123 == toInt " 123 ") + (0 == toInt " 0") + (0 == toInt "0 ") + (0 == toInt " 0 ") + # Zero Padding + (123 == toInt "0123") + (123 == toInt "0000123") + (0 == toInt "000000") + # Whitespace and Zero Padding + (123 == toInt " 0123") + (123 == toInt "0123 ") + (123 == toInt " 0123 ") + (123 == toInt " 0000123") + (123 == toInt "0000123 ") + (123 == toInt " 0000123 ") + (0 == toInt " 000000") + (0 == toInt "000000 ") + (0 == toInt " 000000 ") + ]; + # LISTS testFilter = { |