about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-11-30 23:10:38 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-11-30 23:10:38 +0100
commit3d56f37098c21786b327d98a93d0a7d1f2091b74 (patch)
treee673f83a2b0550c3729bfbfa5bfbe2f3afd8057a
parentfix(tests/{yambar,nvim-checkhealth}): Update to use `Exec` (diff)
downloadnixos-config-3d56f37098c21786b327d98a93d0a7d1f2091b74.tar.gz
nixos-config-3d56f37098c21786b327d98a93d0a7d1f2091b74.zip
feat(tests/nvim-neorg): Init
-rw-r--r--tests/by-name/nv/nvim-neorg/data/index.norg16
-rw-r--r--tests/by-name/nv/nvim-neorg/data/reference.norg11
-rw-r--r--tests/by-name/nv/nvim-neorg/test.desc73
-rw-r--r--tests/by-name/nv/nvim-neorg/test.nix46
4 files changed, 146 insertions, 0 deletions
diff --git a/tests/by-name/nv/nvim-neorg/data/index.norg b/tests/by-name/nv/nvim-neorg/data/index.norg
new file mode 100644
index 00000000..4d643019
--- /dev/null
+++ b/tests/by-name/nv/nvim-neorg/data/index.norg
@@ -0,0 +1,16 @@
+@document.meta
+title: index
+description:
+authors: soispha
+categories:
+created: 2023-08-29
+updated: 2023-08-29
+version: 1.1.1
+@end
+
+* First heading
+- {* Second heading}[Second]
+
+
+* Second heading
+-- {:./reference.norg:}[References]
diff --git a/tests/by-name/nv/nvim-neorg/data/reference.norg b/tests/by-name/nv/nvim-neorg/data/reference.norg
new file mode 100644
index 00000000..b572a469
--- /dev/null
+++ b/tests/by-name/nv/nvim-neorg/data/reference.norg
@@ -0,0 +1,11 @@
+@document.meta
+title: references
+description:
+authors: soispha
+categories:
+created: 2023-08-29
+updated: 2023-08-29
+version: 1.1.1
+@end
+
+* Some other content
diff --git a/tests/by-name/nv/nvim-neorg/test.desc b/tests/by-name/nv/nvim-neorg/test.desc
new file mode 100644
index 00000000..bd7b7312
--- /dev/null
+++ b/tests/by-name/nv/nvim-neorg/test.desc
@@ -0,0 +1,73 @@
+Type nvim
+Sleep 3
+Type Enter
+Sleep 9
+# Remove the spellfile download prompt
+Type C-c
+ExpectNot Warning: Cannot find word list
+Expect Nvim is open source and freely distributable
+
+Type :NeorgStart
+Sleep 1.5
+Type Enter
+Sleep 4
+
+Type :Neorg workspace general
+Sleep 1.5
+Type Enter
+Sleep 4
+
+
+Type 10t
+Sleep 0.5
+
+# Cursor is on the first heading
+Type iMARKER
+Sleep 0.5
+Type Escape
+Sleep 2
+Expect ^11\s*MARKER◉ First heading$
+
+# Now moves to the link to the second
+Type t
+Sleep 0.2
+Type $
+Sleep 0.2
+Type h
+Sleep 0.2
+Type Enter
+Sleep 0.5
+
+# Should be on the second
+Type iMARKER
+Sleep 0.5
+Type Escape
+Sleep 2
+Expect ^15\s*◉ MARKERSecond heading$
+
+# Moves to the references file
+Type t
+Sleep 0.2
+Type $
+Sleep 0.2
+Type h
+Sleep 0.2
+Type Enter
+Sleep 0.5
+
+# Skip another spell file prompt
+Type Enter
+Sleep 0.5
+
+
+Type 10t
+Sleep 0.5
+
+Expect ^11\s*◉ Some other content$
+
+Type :q!
+Sleep 0.5
+Type Enter
+Sleep 1
+
+# vim: ft=tape
diff --git a/tests/by-name/nv/nvim-neorg/test.nix b/tests/by-name/nv/nvim-neorg/test.nix
new file mode 100644
index 00000000..ee0e1b52
--- /dev/null
+++ b/tests/by-name/nv/nvim-neorg/test.nix
@@ -0,0 +1,46 @@
+{
+  mkTest,
+  extraModules,
+  pkgs,
+  ...
+}:
+mkTest {
+  name = "nvim-neorg";
+
+  configuration = {
+    imports = [
+      ../../../../modules/by-name/nv/nvim/module.nix
+      ../../../../modules/by-name/ni/nixpkgs/module.nix
+    ];
+    config = {
+      soispha = {
+        nixpkgs = {
+          enable = true;
+          systemName = "x86_64-linux";
+        };
+        programs.nvim = {
+          enable = true;
+          shell = pkgs.zsh;
+        };
+      };
+      home-manager.users.soispha = {
+        imports = [
+          extraModules.nixvim.homeManagerModule
+        ];
+      };
+    };
+  };
+
+  alternateScreen = false;
+
+  testData = {
+    "/home/soispha/repos/notes/general/index.norg" = ./data/index.norg;
+    "/home/soispha/repos/notes/general/reference.norg" = ./data/reference.norg;
+  };
+
+  description = ./test.desc;
+
+  # The golden file is just full of nvim's terminal control sequences. There is no point
+  # in trying to check it.
+  hash = null;
+}