summaryrefslogtreecommitdiff
path: root/t/t4018
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-11-02 21:17:46 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-11-02 21:17:46 (GMT)
commit292e53fa9d2cf6d0b6d6adbbdc6dfc665bd4babe (patch)
treec6cf86a42e4386b3c37bd23903c672669e8e8bdf /t/t4018
parent305fcf42b4dde316ba0b2e6433c1e5a1d6ef864f (diff)
parent2ff6c34612057baccbd841524106c5a05f6be6d6 (diff)
downloadgit-292e53fa9d2cf6d0b6d6adbbdc6dfc665bd4babe.zip
git-292e53fa9d2cf6d0b6d6adbbdc6dfc665bd4babe.tar.gz
git-292e53fa9d2cf6d0b6d6adbbdc6dfc665bd4babe.tar.bz2
Merge branch 've/userdiff-bash'
The userdiff pattern learned to identify the function definition in POSIX shells and bash. * ve/userdiff-bash: userdiff: support Bash
Diffstat (limited to 't/t4018')
-rw-r--r--t/t4018/bash-arithmetic-function4
-rw-r--r--t/t4018/bash-bashism-style-compact6
-rw-r--r--t/t4018/bash-bashism-style-function4
-rw-r--r--t/t4018/bash-bashism-style-whitespace4
-rw-r--r--t/t4018/bash-conditional-function4
-rw-r--r--t/t4018/bash-missing-parentheses6
-rw-r--r--t/t4018/bash-mixed-style-compact4
-rw-r--r--t/t4018/bash-mixed-style-function4
-rw-r--r--t/t4018/bash-nested-functions6
-rw-r--r--t/t4018/bash-other-characters4
-rw-r--r--t/t4018/bash-posix-style-compact4
-rw-r--r--t/t4018/bash-posix-style-function4
-rw-r--r--t/t4018/bash-posix-style-whitespace4
-rw-r--r--t/t4018/bash-subshell-function4
-rw-r--r--t/t4018/bash-trailing-comment4
15 files changed, 66 insertions, 0 deletions
diff --git a/t/t4018/bash-arithmetic-function b/t/t4018/bash-arithmetic-function
new file mode 100644
index 0000000..c0b276c
--- /dev/null
+++ b/t/t4018/bash-arithmetic-function
@@ -0,0 +1,4 @@
+RIGHT() ((
+
+ ChangeMe = "$x" + "$y"
+))
diff --git a/t/t4018/bash-bashism-style-compact b/t/t4018/bash-bashism-style-compact
new file mode 100644
index 0000000..1ca3126
--- /dev/null
+++ b/t/t4018/bash-bashism-style-compact
@@ -0,0 +1,6 @@
+function RIGHT {
+ function InvalidSyntax{
+ :
+ echo 'ChangeMe'
+ }
+}
diff --git a/t/t4018/bash-bashism-style-function b/t/t4018/bash-bashism-style-function
new file mode 100644
index 0000000..f1de4fa
--- /dev/null
+++ b/t/t4018/bash-bashism-style-function
@@ -0,0 +1,4 @@
+function RIGHT {
+ :
+ echo 'ChangeMe'
+}
diff --git a/t/t4018/bash-bashism-style-whitespace b/t/t4018/bash-bashism-style-whitespace
new file mode 100644
index 0000000..ade85dd
--- /dev/null
+++ b/t/t4018/bash-bashism-style-whitespace
@@ -0,0 +1,4 @@
+ function RIGHT ( ) {
+
+ ChangeMe
+ }
diff --git a/t/t4018/bash-conditional-function b/t/t4018/bash-conditional-function
new file mode 100644
index 0000000..c5949e8
--- /dev/null
+++ b/t/t4018/bash-conditional-function
@@ -0,0 +1,4 @@
+RIGHT() [[ \
+
+ "$a" > "$ChangeMe"
+]]
diff --git a/t/t4018/bash-missing-parentheses b/t/t4018/bash-missing-parentheses
new file mode 100644
index 0000000..8c8a05d
--- /dev/null
+++ b/t/t4018/bash-missing-parentheses
@@ -0,0 +1,6 @@
+function RIGHT {
+ functionInvalidSyntax {
+ :
+ echo 'ChangeMe'
+ }
+}
diff --git a/t/t4018/bash-mixed-style-compact b/t/t4018/bash-mixed-style-compact
new file mode 100644
index 0000000..d9364cb
--- /dev/null
+++ b/t/t4018/bash-mixed-style-compact
@@ -0,0 +1,4 @@
+function RIGHT(){
+ :
+ echo 'ChangeMe'
+}
diff --git a/t/t4018/bash-mixed-style-function b/t/t4018/bash-mixed-style-function
new file mode 100644
index 0000000..555f9b2
--- /dev/null
+++ b/t/t4018/bash-mixed-style-function
@@ -0,0 +1,4 @@
+function RIGHT() {
+
+ ChangeMe
+}
diff --git a/t/t4018/bash-nested-functions b/t/t4018/bash-nested-functions
new file mode 100644
index 0000000..2c9237e
--- /dev/null
+++ b/t/t4018/bash-nested-functions
@@ -0,0 +1,6 @@
+outer() {
+ RIGHT() {
+ :
+ echo 'ChangeMe'
+ }
+}
diff --git a/t/t4018/bash-other-characters b/t/t4018/bash-other-characters
new file mode 100644
index 0000000..a3f390d
--- /dev/null
+++ b/t/t4018/bash-other-characters
@@ -0,0 +1,4 @@
+_RIGHT_0n() {
+
+ ChangeMe
+}
diff --git a/t/t4018/bash-posix-style-compact b/t/t4018/bash-posix-style-compact
new file mode 100644
index 0000000..045bd20
--- /dev/null
+++ b/t/t4018/bash-posix-style-compact
@@ -0,0 +1,4 @@
+RIGHT(){
+
+ ChangeMe
+}
diff --git a/t/t4018/bash-posix-style-function b/t/t4018/bash-posix-style-function
new file mode 100644
index 0000000..a4d1448
--- /dev/null
+++ b/t/t4018/bash-posix-style-function
@@ -0,0 +1,4 @@
+RIGHT() {
+
+ ChangeMe
+}
diff --git a/t/t4018/bash-posix-style-whitespace b/t/t4018/bash-posix-style-whitespace
new file mode 100644
index 0000000..4d984f0
--- /dev/null
+++ b/t/t4018/bash-posix-style-whitespace
@@ -0,0 +1,4 @@
+ RIGHT ( ) {
+
+ ChangeMe
+ }
diff --git a/t/t4018/bash-subshell-function b/t/t4018/bash-subshell-function
new file mode 100644
index 0000000..80baa09
--- /dev/null
+++ b/t/t4018/bash-subshell-function
@@ -0,0 +1,4 @@
+RIGHT() (
+
+ ChangeMe=2
+)
diff --git a/t/t4018/bash-trailing-comment b/t/t4018/bash-trailing-comment
new file mode 100644
index 0000000..f1edbed
--- /dev/null
+++ b/t/t4018/bash-trailing-comment
@@ -0,0 +1,4 @@
+RIGHT() { # Comment
+
+ ChangeMe
+}