From 9fc7da1e08d83378f8b0d66a060d92929c1468cf Mon Sep 17 00:00:00 2001
From: Eelco Dolstra <edolstra@gmail.com>
Date: Fri, 9 Jul 2021 01:16:55 +0200
Subject: [PATCH] Add test for #4992

---
 tests/nix-shell.sh | 2 ++
 tests/shell.nix    | 1 +
 2 files changed, 3 insertions(+)

diff --git a/tests/nix-shell.sh b/tests/nix-shell.sh
index aae7cbcde..728313a8a 100644
--- a/tests/nix-shell.sh
+++ b/tests/nix-shell.sh
@@ -99,3 +99,5 @@ nix_develop -f shell.nix shellDrv -c echo foo |& grep -q foo
 source <(nix print-dev-env -f shell.nix shellDrv)
 [[ -n $stdenv ]]
 [[ ${arr1[2]} = "3 4" ]]
+[[ ${arr2[1]} = $'\n' ]]
+[[ ${arr2[2]} = $'x\ny' ]]
diff --git a/tests/shell.nix b/tests/shell.nix
index 42d2d2033..1f5526253 100644
--- a/tests/shell.nix
+++ b/tests/shell.nix
@@ -21,6 +21,7 @@ let pkgs = rec {
       export PATH=$PATH:$pkg/bin
     done
     declare -a arr1=(1 2 "3 4" 5)
+    declare -a arr2=(x $'\n' $'x\ny')
   '';
 
   stdenv = mkDerivation {
-- 
GitLab