[SCM] Git repository for devscripts branch, master, updated. v2.12.4-47-g1b29202
Benjamin Drung
bdrung at debian.org
Thu Oct 25 21:30:11 UTC 2012
The following commit has been merged in the master branch:
commit 40e5993c930469a556c84203e8248d57c28a7d12
Author: Benjamin Drung <bdrung at debian.org>
Date: Thu Oct 25 23:17:03 2012 +0200
Add test case from Raphael Geissert for previous commit.
diff --git a/test/bashisms/return.sh b/test/bashisms/return.sh
new file mode 100644
index 0000000..c6735e0
--- /dev/null
+++ b/test/bashisms/return.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+foo() {
+ return -- 1 # BASHISM
+}
+
+bar () {
+ return 256 # BASHISM
+}
+
+moo () {
+ return -1 # BASHISM
+}
diff --git a/test/bashisms/return.sh.out b/test/bashisms/return.sh.out
new file mode 100644
index 0000000..ad1aae0
--- /dev/null
+++ b/test/bashisms/return.sh.out
@@ -0,0 +1,6 @@
+possible bashism in bashisms/return.sh line 4 ('exit --' should be 'exit' (idem for return)):
+ return -- 1 # BASHISM
+possible bashism in bashisms/return.sh line 8 (exit|return status code greater than 255):
+ return 256 # BASHISM
+possible bashism in bashisms/return.sh line 12 (exit|return with negative status code):
+ return -1 # BASHISM
diff --git a/test/test_checkbashisms b/test/test_checkbashisms
index 1cbeb71..1c425f1 100755
--- a/test/test_checkbashisms
+++ b/test/test_checkbashisms
@@ -133,6 +133,10 @@ test_quoted_strings() {
found "bashisms/quoted-strings.sh" "$(cat bashisms/quoted-strings.sh.out)"
}
+test_return() {
+ found "bashisms/return.sh" "$(cat bashisms/return.sh.out)"
+}
+
test_shell_vars() {
clean "-f bashisms/shell-vars.mk"
}
--
Git repository for devscripts
More information about the devscripts-devel
mailing list