summary refs log tree commit diff
path: root/nixos/tests/ucg.nix
diff options
context:
space:
mode:
authorAndersonTorres <torres.anderson.85@protonmail.com>2020-11-29 20:00:38 -0300
committerAndersonTorres <torres.anderson.85@protonmail.com>2020-11-30 16:21:41 -0300
commit4bcdf302e1d7a592cbda23a11b7797d16c79f0c9 (patch)
tree20f0256e3bcf56020d486748813eda4a10c0baaf /nixos/tests/ucg.nix
parente23f098b6946c3eae45e66d16746a65903fc3d74 (diff)
downloadnixpkgs-4bcdf302e1d7a592cbda23a11b7797d16c79f0c9.tar
nixpkgs-4bcdf302e1d7a592cbda23a11b7797d16c79f0c9.tar.gz
nixpkgs-4bcdf302e1d7a592cbda23a11b7797d16c79f0c9.tar.bz2
nixpkgs-4bcdf302e1d7a592cbda23a11b7797d16c79f0c9.tar.lz
nixpkgs-4bcdf302e1d7a592cbda23a11b7797d16c79f0c9.tar.xz
nixpkgs-4bcdf302e1d7a592cbda23a11b7797d16c79f0c9.tar.zst
nixpkgs-4bcdf302e1d7a592cbda23a11b7797d16c79f0c9.zip
ucg: init at 20190225
Diffstat (limited to 'nixos/tests/ucg.nix')
-rw-r--r--nixos/tests/ucg.nix18
1 files changed, 18 insertions, 0 deletions
diff --git a/nixos/tests/ucg.nix b/nixos/tests/ucg.nix
new file mode 100644
index 00000000000..47507aee07c
--- /dev/null
+++ b/nixos/tests/ucg.nix
@@ -0,0 +1,18 @@
+import ./make-test-python.nix ({ pkgs, ... }: {
+  name = "ucg";
+  meta = with pkgs.stdenv.lib.maintainers; {
+    maintainers = [ AndersonTorres ];
+  };
+
+  machine = { pkgs, ... }: {
+    environment.systemPackages = [ pkgs.ucg ];
+  };
+
+  testScript = ''
+    machine.succeed("echo 'Lorem ipsum dolor sit amet\n2.7182818284590' > /tmp/foo")
+    assert "dolor" in machine.succeed("ucg 'dolor' /tmp/foo")
+    assert "Lorem" in machine.succeed("ucg --ignore-case 'lorem' /tmp/foo")
+    machine.fail("ucg --word-regexp '2718' /tmp/foo")
+    machine.fail("ucg 'pisum' /tmp/foo")
+  '';
+})