aboutsummaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/lf/lf-make-map/tests/cases/dot_dirs_duplicates
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-06-02 21:53:52 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-06-02 21:53:52 +0200
commitff84099835c636e00d8812b54be335ff220af0da (patch)
tree069254a6358f114acf0cb74b3754e1216951ecb2 /pkgs/by-name/lf/lf-make-map/tests/cases/dot_dirs_duplicates
parentmodules/lf: Use the new lf-make-map interactive mode (diff)
downloadnixos-config-ff84099835c636e00d8812b54be335ff220af0da.zip
pkgs/lf-make-map: Special case dot-directories
That makes the mappings for `~/.config` or `~/.local` more accessible.
Diffstat (limited to 'pkgs/by-name/lf/lf-make-map/tests/cases/dot_dirs_duplicates')
-rw-r--r--pkgs/by-name/lf/lf-make-map/tests/cases/dot_dirs_duplicates/output.old17
-rwxr-xr-xpkgs/by-name/lf/lf-make-map/tests/cases/dot_dirs_duplicates/test.sh53
2 files changed, 70 insertions, 0 deletions
diff --git a/pkgs/by-name/lf/lf-make-map/tests/cases/dot_dirs_duplicates/output.old b/pkgs/by-name/lf/lf-make-map/tests/cases/dot_dirs_duplicates/output.old
new file mode 100644
index 00000000..f7523ba3
--- /dev/null
+++ b/pkgs/by-name/lf/lf-make-map/tests/cases/dot_dirs_duplicates/output.old
@@ -0,0 +1,17 @@
+map gca. cd "/tmp/tmp.DfcgjemfCG/cats"
+map gcaa. cd "/tmp/tmp.DfcgjemfCG/cats/apzu"
+map gcal. cd "/tmp/tmp.DfcgjemfCG/cats/lahmu"
+map gcat. cd "/tmp/tmp.DfcgjemfCG/cats/tiamat"
+map gco. cd "/tmp/tmp.DfcgjemfCG/.config"
+map gcoa. cd "/tmp/tmp.DfcgjemfCG/.config/apzu"
+map gcol. cd "/tmp/tmp.DfcgjemfCG/.config/lahmu"
+map gcot. cd "/tmp/tmp.DfcgjemfCG/.config/tiamat"
+map gd. cd "/tmp/tmp.DfcgjemfCG/documents"
+map gda. cd "/tmp/tmp.DfcgjemfCG/documents/apzu"
+map gdl. cd "/tmp/tmp.DfcgjemfCG/documents/lahmu"
+map gdt. cd "/tmp/tmp.DfcgjemfCG/documents/tiamat"
+map gl. cd "/tmp/tmp.DfcgjemfCG/.local"
+map gln. cd "/tmp/tmp.DfcgjemfCG/.local/nvim"
+map glsh. cd "/tmp/tmp.DfcgjemfCG/.local/share"
+map glst. cd "/tmp/tmp.DfcgjemfCG/.local/state"
+
diff --git a/pkgs/by-name/lf/lf-make-map/tests/cases/dot_dirs_duplicates/test.sh b/pkgs/by-name/lf/lf-make-map/tests/cases/dot_dirs_duplicates/test.sh
new file mode 100755
index 00000000..33447e54
--- /dev/null
+++ b/pkgs/by-name/lf/lf-make-map/tests/cases/dot_dirs_duplicates/test.sh
@@ -0,0 +1,53 @@
+#! /usr/bin/env sh
+
+# nixos-config - My current NixOS configuration
+#
+# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+# SPDX-License-Identifier: GPL-3.0-or-later
+#
+# This file is part of my nixos-config.
+#
+# You should have received a copy of the License along with this program.
+# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
+
+mkFile() {
+ t="$1"
+
+ mkdir --parents "$(dirname "$t")"
+ echo "TEST_FILE" >"$t"
+}
+
+# We need to hard code this, so that our output matches the golden sample.
+base="/tmp/tmp.DfcgjemfCG"
+test="$(mktemp --directory -t lf_make_temp_test_XXXXX)"
+
+if [ -d "$base" ]; then
+ rm --recursive "$base"
+fi
+mkdir "$base"
+
+cleanup() {
+ rm --recursive "$base" "$test"
+}
+trap cleanup EXIT
+
+mkFile "$base/.local/share/file1.txt"
+mkFile "$base/.local/state/file1.txt"
+mkFile "$base/.local/nvim/log.LOG"
+mkFile "$base/.local/.tog/TOG.LOG"
+
+mkFile "$base/.config/apzu/file2.txt"
+mkFile "$base/.config/tiamat/file2.txt"
+mkFile "$base/.config/lahmu/file2.txt"
+
+mkFile "$base/documents/apzu/file2.txt"
+mkFile "$base/documents/tiamat/file2.txt"
+mkFile "$base/documents/lahmu/file2.txt"
+
+mkFile "$base/cats/apzu/file2.txt"
+mkFile "$base/cats/tiamat/file2.txt"
+mkFile "$base/cats/lahmu/file2.txt"
+
+execute_make_maps --home-name "$base" --depth 100 generate "$base/.local" "$base/.config" "$base/documents" "$base/cats" >"$test/output.new"
+
+diff "$test/output.new" "$(dirname "$LOCATION")/output.old"