From 224ec708f761b2515851058c3dcd9d987b5258a4 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Tue, 11 Oct 2022 22:29:05 -0700 Subject: test(tvix/eval): add eval-okay-parsedrvname.{exp,nix} Signed-off-by: Adam Joseph Change-Id: I59254a0ac513b3d2a6b2184554358bb6eba2ba99 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6949 Tested-by: BuildkiteCI Reviewed-by: tazjin --- tvix/eval/src/tests/tvix_tests/eval-okay-parsedrvname.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-parsedrvname.nix (limited to 'tvix/eval/src/tests/tvix_tests/eval-okay-parsedrvname.nix') diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-parsedrvname.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-parsedrvname.nix new file mode 100644 index 000000000000..fea6e234dcfd --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-parsedrvname.nix @@ -0,0 +1,12 @@ + +# the first dash followed by a non-alphabetic character separates +# the "name" from the "version" + +assert builtins.parseDrvName "ripgrep-1.2" == { name = "ripgrep"; version = "1.2"; }; +assert builtins.parseDrvName "rip-grep-1.2" == { name = "rip-grep"; version = "1.2"; }; +assert builtins.parseDrvName "7zip_archiver-0.2" == { name = "7zip_archiver"; version = "0.2"; }; +assert builtins.parseDrvName "gcc-1-2" == { name = "gcc"; version = "1-2"; }; +assert builtins.parseDrvName "bash--1-2" == { name = "bash"; version = "-1-2"; }; +assert builtins.parseDrvName "xvidtune-?1-2" == { name = "xvidtune"; version = "?1-2"; }; + +true -- cgit 1.4.1