aboutsummaryrefslogtreecommitdiff
path: root/tests/modules/programs/readline
diff options
context:
space:
mode:
authorRobert Helgesson <robert@rycee.net>2019-12-08 21:11:08 +0100
committerRobert Helgesson <robert@rycee.net>2019-12-08 21:13:58 +0100
commit284b8d94d41e0c0c7842749c6e69db6a72ad1df3 (patch)
tree71edb13f6d9252f35017820c11cf6e19b43921ab /tests/modules/programs/readline
parentbb5dea02b9b61c77f3a15a2ffa59f1102a737326 (diff)
readline: add variables option
Also add a basic test case.
Diffstat (limited to 'tests/modules/programs/readline')
-rw-r--r--tests/modules/programs/readline/default.nix3
-rw-r--r--tests/modules/programs/readline/using-all-options.nix33
-rw-r--r--tests/modules/programs/readline/using-all-options.txt11
3 files changed, 47 insertions, 0 deletions
diff --git a/tests/modules/programs/readline/default.nix b/tests/modules/programs/readline/default.nix
new file mode 100644
index 00000000000..767d88bfa9d
--- /dev/null
+++ b/tests/modules/programs/readline/default.nix
@@ -0,0 +1,3 @@
+{
+ readline-using-all-options = ./using-all-options.nix;
+}
diff --git a/tests/modules/programs/readline/using-all-options.nix b/tests/modules/programs/readline/using-all-options.nix
new file mode 100644
index 00000000000..f50117679b4
--- /dev/null
+++ b/tests/modules/programs/readline/using-all-options.nix
@@ -0,0 +1,33 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+{
+ config = {
+ programs.readline = {
+ enable = true;
+
+ bindings = {
+ "\C-h" = "backward-kill-word";
+ };
+
+ variables = {
+ bell-style = "audible";
+ completion-map-case = true;
+ completion-prefix-display-length = 2;
+ };
+
+ extraConfig = ''
+ $if mode=emacs
+ "\e[1~": beginning-of-line
+ $endif
+ '';
+ };
+
+ nmt.script = ''
+ assertFileContent \
+ home-files/.inputrc \
+ ${./using-all-options.txt}
+ '';
+ };
+}
diff --git a/tests/modules/programs/readline/using-all-options.txt b/tests/modules/programs/readline/using-all-options.txt
new file mode 100644
index 00000000000..da9f7df6847
--- /dev/null
+++ b/tests/modules/programs/readline/using-all-options.txt
@@ -0,0 +1,11 @@
+# Generated by Home Manager.
+
+$include /etc/inputrc
+set bell-style audible
+set completion-map-case on
+set completion-prefix-display-length 2
+"C-h": backward-kill-word
+$if mode=emacs
+"\e[1~": beginning-of-line
+$endif
+