Skip to content

Commit

Permalink
bash: Add a test for PS1 error
Browse files Browse the repository at this point in the history
Add `run-ps1lf`.
  • Loading branch information
k-takata committed Oct 2, 2024
1 parent 88dda27 commit 86781a3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
25 changes: 25 additions & 0 deletions bash/0005-bash-4.3-msys2-fix-lineendings.patch
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,31 @@ index 2001b4e..3ba2029 100644
}
else
break;
diff --git a/tests/ps1lf.right b/tests/ps1lf.right
new file mode 100644
index 0000000..bbed883
--- /dev/null
+++ b/tests/ps1lf.right
@@ -0,0 +1,4 @@
+foo
+$ PS1='$(echo foo)\n\$ '
+foo
+$ exit
diff --git a/tests/ps1lf.sub b/tests/ps1lf.sub
new file mode 100644
index 0000000..01a2265
--- /dev/null
+++ b/tests/ps1lf.sub
@@ -0,0 +1 @@
+PS1='$(echo foo)\n\$ '
diff --git a/tests/run-ps1lf b/tests/run-ps1lf
new file mode 100644
index 0000000..030f606
--- /dev/null
+++ b/tests/run-ps1lf
@@ -0,0 +1,2 @@
+${THIS_SH} --rcfile ./ps1lf.sub -i < ./ps1lf.sub 2>&1 | tr -d '\r' > ${BASH_TSTOUT}
+diff ${BASH_TSTOUT} ps1lf.right && rm -f ${BASH_TSTOUT}
diff --git a/variables.c b/variables.c
index 028667c..a10594d 100644
--- a/variables.c
Expand Down
2 changes: 1 addition & 1 deletion bash/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ sha256sums=('a139c166df7ff4471c5e0733051642ee5556c1cc8a4a78f145583c5c81ab32fb'
'SKIP'
'948b8b5401dcb4e5eb577cfa6543e740e2e3bd0690939d8e77d078d75d110097'
'6ca7633a87db7caf1d2d1a96779681c365d0ad2c11b2ea758e772f4ebff2a62f'
'ed6a63d0e0c1d5d90e5c12405f606d2cb385f68d32181b65e0fbafd49f40f6f1'
'9ee6a3f0c6c27ca68974419d10b40ee036579b939e38d5c6408629f33c3caf8b'
'500c75c64593a70276585345a55c807226c0cc220d08b7cccece2ab005b3bcea'
'cbae1aa81d56eba4e916bdaf2b2983731d6e2537dd8d606a3b378e49bcb81e79'
'f42f2fee923bc2209f406a1892772121c467f44533bedfe00a176139da5d310a'
Expand Down

0 comments on commit 86781a3

Please sign in to comment.