[SCM] Git repository for devscripts branch, master, updated. v2.12.4-55-g9e10e6c

Benjamin Drung bdrung at debian.org
Fri Oct 26 12:00:42 UTC 2012


The following commit has been merged in the master branch:
commit 56d01ea97a49919dd88d8d9d4905551e3e950e12
Author: Benjamin Drung <bdrung at debian.org>
Date:   Fri Oct 26 13:57:40 2012 +0200

    Add test case from Raphael Geissert for previous commit.

diff --git a/test/bashisms/sleep.sh b/test/bashisms/sleep.sh
new file mode 100644
index 0000000..410748c
--- /dev/null
+++ b/test/bashisms/sleep.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+sleep 0.1 # BASHISM
+sleep 1s # BASHISM
+sleep 1d # BASHISM
+sleep -- 1 # BASHISM
+sleep 1.5s # BASHISM
+sleep 1 2 3 # BASHISM
diff --git a/test/bashisms/sleep.sh.out b/test/bashisms/sleep.sh.out
new file mode 100644
index 0000000..e619bd3
--- /dev/null
+++ b/test/bashisms/sleep.sh.out
@@ -0,0 +1,12 @@
+possible bashism in bashisms/sleep.sh line 3 (sleep only takes one integer):
+sleep 0.1 # BASHISM
+possible bashism in bashisms/sleep.sh line 4 (sleep only takes one integer):
+sleep 1s # BASHISM
+possible bashism in bashisms/sleep.sh line 5 (sleep only takes one integer):
+sleep 1d # BASHISM
+possible bashism in bashisms/sleep.sh line 6 (sleep only takes one integer):
+sleep -- 1 # BASHISM
+possible bashism in bashisms/sleep.sh line 7 (sleep only takes one integer):
+sleep 1.5s # BASHISM
+possible bashism in bashisms/sleep.sh line 8 (sleep only takes one integer):
+sleep 1 2 3 # BASHISM
diff --git a/test/test_checkbashisms b/test/test_checkbashisms
index 055ac11..396ce51 100755
--- a/test/test_checkbashisms
+++ b/test/test_checkbashisms
@@ -145,6 +145,10 @@ test_shell_vars() {
     clean "-f bashisms/shell-vars.mk"
 }
 
+test_sleep() {
+    found "bashisms/sleep.sh" "$(cat bashisms/sleep.sh.out)"
+}
+
 test_source() {
     found "bashisms/source" "$(cat bashisms/source.out)"
 }

-- 
Git repository for devscripts



More information about the devscripts-devel mailing list