summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorAndrew Tropin <andrew@trop.in>2023-01-09 12:22:56 +0400
committerAndrew Tropin <andrew@trop.in>2023-01-09 12:22:56 +0400
commit35ecbb418c03e3957ebab87af921742466fe2de9 (patch)
treea8e524be0b4167b67ab539285476edbd6fd00cb1 /tests
parent2acce55a00df9344d73101bb57a3961ba86105b0 (diff)
downloadguix-35ecbb418c03e3957ebab87af921742466fe2de9.tar.gz
home: environment-variables: Fix escaping.
* gnu/home/services.scm (environment-variable-shell-definitions): Fix
escaping.
* tests/guix-home.sh: Add STRING_WITH_ESCAPES environment variable and test
its value.

Reported-by: elevnkb
Diffstat (limited to 'tests')
-rw-r--r--tests/guix-home.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/guix-home.sh b/tests/guix-home.sh
index 83ca6e72c8..3151f66683 100644
--- a/tests/guix-home.sh
+++ b/tests/guix-home.sh
@@ -84,8 +84,9 @@ trap 'chmod -Rf +w "$test_directory"; rm -rf "$test_directory"' EXIT
                    home-environment-variables-service-type
                    `(("TODAY" . "26 messidor")
                      ("SHELL" . ,(file-append bash "/bin/bash"))
-                     ("BUILDHOSTTIME" . ,#~(strftime "%c"
-                                            (localtime (current-time))))
+                     ("BUILDHOST_TIME" . ,#~(strftime "%c"
+                                             (localtime (current-time))))
+                     ("STRING_WITH_ESCAPES" . "chars: \" /\\")
                      ("LITERAL" . ,(literal-string "${abc}"))))
 
    (simple-service 'home-bash-service-extension-test
@@ -157,6 +158,8 @@ EOF
     ( . "${HOME}/.guix-home/setup-environment"; test "$TODAY" = "26 messidor" )
     ( . "${HOME}/.guix-home/setup-environment"; test "$LITERAL" = '${abc}' )
     ( . "${HOME}/.guix-home/setup-environment";
+      test "$STRING_WITH_ESCAPES" = "chars: \" /\\")
+    ( . "${HOME}/.guix-home/setup-environment";
       echo "$SHELL" | grep "/gnu/store/.*/bin/bash" )
 
     # This one should still be here.