about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Olsen <daniel.olsen99@gmail.com>2022-06-23 22:46:23 +0200
committerDaniel Olsen <daniel.olsen99@gmail.com>2022-10-20 20:12:15 +0200
commit23c1754fff74ee55ca2fa7188130805a7793c9c0 (patch)
tree52218f117eaaef078c3110c830a240572fd638ca /lib
parent3251123a779636d6883032f158ff99ebe98c0da4 (diff)
lib/tests/misc: Add tests for charToInt, escapeC, and normalizePath
Diffstat (limited to 'lib')
-rw-r--r--lib/tests/misc.nix15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/tests/misc.nix b/lib/tests/misc.nix
index 74020bc7c8e5d..8e0cf1f45bb60 100644
--- a/lib/tests/misc.nix
+++ b/lib/tests/misc.nix
@@ -312,6 +312,21 @@ runTests {
     expected = true;
   };
 
+  testNormalizePath = {
+    expr = strings.normalizePath "//a/b//c////d/";
+    expected = "/a/b/c/d/";
+  };
+
+  testCharToInt = {
+    expr = strings.charToInt "A";
+    expected = 65;
+  };
+
+  testEscapeC = {
+    expr = strings.escapeC [ " " ] "Hello World";
+    expected = "Hello\\x20World";
+  };
+
 # LISTS
 
   testFilter = {