summaryrefslogtreecommitdiff
path: root/t/t4018
diff options
context:
space:
mode:
authorAdrien Schildknecht <adrien+dev@schischi.me>2015-03-10 00:40:32 +0100
committerJunio C Hamano <gitster@pobox.com>2015-03-13 21:56:52 -0700
commitf7711b353572616e7d2fdff7a3cc5f757d314eb8 (patch)
treec0f40891db419cdc384748c18e226db09f0ebcda /t/t4018
parent1165ae6f3d42e0eb0ddfc2d4e6dfa8bd0b88eb60 (diff)
downloadgit-as/userdiff-sh.tar.gz
userdiff: funcname and word patterns for shas/userdiff-sh
Add regexp based on the "Shell Command Language" specifications. Because of the lax syntax of sh, some corner cases may not be handled properly. Signed-off-by: Adrien Schildknecht <adrien+dev@schischi.me> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4018')
-rw-r--r--t/t4018/sh-function4
-rw-r--r--t/t4018/sh-function-comment6
-rw-r--r--t/t4018/sh-function-nested7
-rw-r--r--t/t4018/sh-function-prefix4
-rw-r--r--t/t4018/sh-function-string4
5 files changed, 25 insertions, 0 deletions
diff --git a/t/t4018/sh-function b/t/t4018/sh-function
new file mode 100644
index 0000000000..1d5096a0ac
--- /dev/null
+++ b/t/t4018/sh-function
@@ -0,0 +1,4 @@
+RIGHT_foo()
+{
+ ChangeMe;
+}
diff --git a/t/t4018/sh-function-comment b/t/t4018/sh-function-comment
new file mode 100644
index 0000000000..f340ee79e4
--- /dev/null
+++ b/t/t4018/sh-function-comment
@@ -0,0 +1,6 @@
+ RIGHT_foo() # echo 'foo'
+#bar()
+{
+ #bar()
+ ChangeMe;
+}
diff --git a/t/t4018/sh-function-nested b/t/t4018/sh-function-nested
new file mode 100644
index 0000000000..d3263f3ade
--- /dev/null
+++ b/t/t4018/sh-function-nested
@@ -0,0 +1,7 @@
+foo ( )
+{
+ RIGHT_bar()
+ {
+ echo ChangeMe
+ }
+}
diff --git a/t/t4018/sh-function-prefix b/t/t4018/sh-function-prefix
new file mode 100644
index 0000000000..e96eb7aa58
--- /dev/null
+++ b/t/t4018/sh-function-prefix
@@ -0,0 +1,4 @@
+function RIGHT_foo()
+{
+ ChangeMe;
+}
diff --git a/t/t4018/sh-function-string b/t/t4018/sh-function-string
new file mode 100644
index 0000000000..f60a899bc3
--- /dev/null
+++ b/t/t4018/sh-function-string
@@ -0,0 +1,4 @@
+RIGHT_foo() {
+ echo "bar()"
+ ChangeMe;
+}