From 23c1754fff74ee55ca2fa7188130805a7793c9c0 Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Thu, 23 Jun 2022 22:46:23 +0200 Subject: [PATCH] lib/tests/misc: Add tests for charToInt, escapeC, and normalizePath --- lib/tests/misc.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 = {