summaryrefslogtreecommitdiff
path: root/src/testdir
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2015-03-20 19:06:06 +0100
committerBram Moolenaar <Bram@vim.org>2015-03-20 19:06:06 +0100
commitdcefba993456263100785f18d21d780cf531f2dc (patch)
treee49c2f941f0b18b30195d0be08bf6ade5c7683a5 /src/testdir
parent3b7b83649cd9c486afd6fbdb33e4450616c4bd46 (diff)
downloadvim-dcefba993456263100785f18d21d780cf531f2dc.zip
updated for version 7.4.670
Problem: Using 'cindent' for Javascript is less than perfect. Solution: Improve indenting of continuation lines. (Hirohito Higashi)
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/test3.in158
-rw-r--r--src/testdir/test3.ok153
2 files changed, 311 insertions, 0 deletions
diff --git a/src/testdir/test3.in b/src/testdir/test3.in
index 7757569e3..a321bb885 100644
--- a/src/testdir/test3.in
+++ b/src/testdir/test3.in
@@ -2065,6 +2065,164 @@ return true;
JSEND
STARTTEST
+:set cino=j1,J1,+2
+/^JSSTART
+=/^JSEND
+ENDTEST
+
+JSSTART
+// Results of JavaScript indent
+// 1
+(function(){
+var a = [
+'a',
+'b',
+'c',
+'d',
+'e',
+'f',
+'g',
+'h',
+'i'
+];
+}())
+
+// 2
+(function(){
+var a = [
+0 +
+5 *
+9 *
+'a',
+'b',
+0 +
+5 *
+9 *
+'c',
+'d',
+'e',
+'f',
+'g',
+'h',
+'i'
+];
+}())
+
+// 3
+(function(){
+var a = [
+0 +
+// comment 1
+5 *
+/* comment 2 */
+9 *
+'a',
+'b',
+0 +
+5 *
+9 *
+'c',
+'d',
+'e',
+'f',
+'g',
+'h',
+'i'
+];
+}())
+
+// 4
+{
+var a = [
+0,
+1
+];
+var b;
+var c;
+}
+
+// 5
+{
+var a = [
+[
+0
+],
+2,
+3
+];
+}
+
+// 6
+{
+var a = [
+[
+0,
+1
+],
+2,
+3
+];
+}
+
+// 7
+{
+var a = [
+// [
+0,
+// 1
+// ],
+2,
+3
+];
+}
+
+// 8
+var x = [
+(function(){
+var a,
+b,
+c,
+d,
+e,
+f,
+g,
+h,
+i;
+})
+];
+
+// 9
+var a = [
+0 +
+5 *
+9 *
+'a',
+'b',
+0 +
+5 *
+9 *
+'c',
+'d',
+'e',
+'f',
+'g',
+'h',
+'i'
+];
+
+// 10
+var a,
+b,
+c,
+d,
+e,
+f,
+g,
+h,
+i;
+JSEND
+
+STARTTEST
:g/^STARTTEST/.,/^ENDTEST/d
:1;/start of AUTO/,$wq! test.out
ENDTEST
diff --git a/src/testdir/test3.ok b/src/testdir/test3.ok
index e75de0ffa..b1c8b7088 100644
--- a/src/testdir/test3.ok
+++ b/src/testdir/test3.ok
@@ -1832,3 +1832,156 @@ JSSTART
})(jQuery);
JSEND
+
+JSSTART
+// Results of JavaScript indent
+// 1
+(function(){
+ var a = [
+ 'a',
+ 'b',
+ 'c',
+ 'd',
+ 'e',
+ 'f',
+ 'g',
+ 'h',
+ 'i'
+ ];
+}())
+
+// 2
+(function(){
+ var a = [
+ 0 +
+ 5 *
+ 9 *
+ 'a',
+ 'b',
+ 0 +
+ 5 *
+ 9 *
+ 'c',
+ 'd',
+ 'e',
+ 'f',
+ 'g',
+ 'h',
+ 'i'
+ ];
+}())
+
+// 3
+(function(){
+ var a = [
+ 0 +
+ // comment 1
+ 5 *
+ /* comment 2 */
+ 9 *
+ 'a',
+ 'b',
+ 0 +
+ 5 *
+ 9 *
+ 'c',
+ 'd',
+ 'e',
+ 'f',
+ 'g',
+ 'h',
+ 'i'
+ ];
+}())
+
+// 4
+{
+ var a = [
+ 0,
+ 1
+ ];
+ var b;
+ var c;
+}
+
+// 5
+{
+ var a = [
+ [
+ 0
+ ],
+ 2,
+ 3
+ ];
+}
+
+// 6
+{
+ var a = [
+ [
+ 0,
+ 1
+ ],
+ 2,
+ 3
+ ];
+}
+
+// 7
+{
+ var a = [
+ // [
+ 0,
+ // 1
+ // ],
+ 2,
+ 3
+ ];
+}
+
+// 8
+var x = [
+ (function(){
+ var a,
+ b,
+ c,
+ d,
+ e,
+ f,
+ g,
+ h,
+ i;
+ })
+];
+
+// 9
+var a = [
+ 0 +
+ 5 *
+ 9 *
+ 'a',
+ 'b',
+ 0 +
+ 5 *
+ 9 *
+ 'c',
+ 'd',
+ 'e',
+ 'f',
+ 'g',
+ 'h',
+ 'i'
+];
+
+// 10
+var a,
+ b,
+ c,
+ d,
+ e,
+ f,
+ g,
+ h,
+ i;
+JSEND
+