From 133588b181a49c81ac41cd21dd434c395b46480c Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Wed, 9 Oct 2013 20:16:58 +0900 Subject: [PATCH 1/5] Testing with Vader.vim --- autoload/easy_align.vim | 2 - test/READMD.md | 13 ++ test/easy-align.vader | 369 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 382 insertions(+), 2 deletions(-) create mode 100644 test/READMD.md create mode 100644 test/easy-align.vader diff --git a/autoload/easy_align.vim b/autoload/easy_align.vim index 8c69812..dacc1e3 100644 --- a/autoload/easy_align.vim +++ b/autoload/easy_align.vim @@ -551,9 +551,7 @@ function! s:input(str, default, vis) " EasyAlign command can be called without visual selection redraw endif - call inputsave() let got = input(a:str, a:default) - call inputrestore() return got endfunction diff --git a/test/READMD.md b/test/READMD.md new file mode 100644 index 0000000..dc95d58 --- /dev/null +++ b/test/READMD.md @@ -0,0 +1,13 @@ +Test cases for vim-easy-align +============================= + +### Prerequisite + +- [Vader.vim](https://github.com/junegunn/vader.vim) + +### Run + +```vim +:Vader * +``` + diff --git a/test/easy-align.vader b/test/easy-align.vader new file mode 100644 index 0000000..4e29b36 --- /dev/null +++ b/test/easy-align.vader @@ -0,0 +1,369 @@ +Execute: + silent! unlet g:easy_align_delimiters + silent! unlet g:easy_align_ignore_groups + silent! unlet g:easy_align_ignore_unmatched + silent! unlet g:easy_align_indentation + silent! unlet g:easy_align_delimiter_align + vnoremap :EasyAlign + +Given (the beatles): + Paul McCartney 1942 + George Harrison 1943mmdd + Ringo Starr 1940mm + Pete Best 1941 + +Do (around first space): + vip + \ + \ + +Expect: + Paul McCartney 1942 + George Harrison 1943mmdd + Ringo Starr 1940mm + Pete Best 1941 + +Do (around second space): + vip + \ + 2\ + +Expect: + Paul McCartney 1942 + George Harrison 1943mmdd + Ringo Starr 1940mm + Pete Best 1941 + +Do (around all spaces): + vip + \ + *\ + +Expect: + Paul McCartney 1942 + George Harrison 1943mmdd + Ringo Starr 1940mm + Pete Best 1941 + +Do (right-align around all spaces): + vip + \\ + *\ + +Expect: + Paul McCartney 1942 + George Harrison 1943mmdd + Ringo Starr 1940mm + Pete Best 1941 + +Do (center-align around all spaces): + vip + \\\ + *\ + +Expect: + Paul McCartney 1942 + George Harrison 1943mmdd + Ringo Starr 1940mm + Pete Best 1941 + +Do (center-align around the last space): + vip + \\\ + -\ + +Expect: + Paul McCartney 1942 + George Harrison 1943mmdd + Ringo Starr 1940mm + Pete Best 1941 + +Do (right-align around second space): + vip + \\ + 2\ + +Expect: + Paul McCartney 1942 + George Harrison 1943mmdd + Ringo Starr 1940mm + Pete Best 1941 + +Do (left-right alternating alignment): + vip + \ + **\ + +Expect: + Paul McCartney 1942 + George Harrison 1943mmdd + Ringo Starr 1940mm + Pete Best 1941 + +Do (right-left alternating alignment): + vip + \\ + **\ + +Expect: + Paul McCartney 1942 + George Harrison 1943mmdd + Ringo Starr 1940mm + Pete Best 1941 + +Do (with numeric left/right margin): + vip + \ + * + \2\ + \ + \5\ + * + \ + +Expect: + Paul McCartney 1942 + George Harrison 1943mmdd + Ringo Starr 1940mm + Pete Best 1941 + +Do (with string left/right margin): + vip + \ + \lft\ + \rgt\ + *\ + +Expect: + Paul lft rgtMcCartneylft rgt1942 + Georgelft rgtHarrison lft rgt1943mmdd + Ringo lft rgtStarr lft rgt1940mm + Pete lft rgtBest lft rgt1941 + +Execute (with regular expression): + 1,4EasyAlign*/../ + +Expect: + Pa ul Mc Ca rt ne y 19 42 + Ge or ge Ha rr is on 19 43 mm dd + Ri ng o St ar r 19 40 mm + Pe te Be st 19 41 + +Expect: + Paul McCartney 1942 + George Harrison 1943mmdd + Ringo Starr 1940mm + Pete Best 1941 + +########################################################### + +Given ruby (delimiters in comments and strings): + xyz="abc=def" + a=b#=c + +Do (align around all =): + vip + \*= + +Expect ruby (are not aligned): + xyz = "abc=def" + a = b#=c + +########################################################### + +Given javascript (json): + var jdbc = { + // JDBC driver for MySQL database: + driver: "com.mysql.jdbc.Driver", + /* JDBC URL for the connection (jdbc:mysql://HOSTNAME/DATABASE) */ + url: 'jdbc:mysql://localhost/test', + database: "test", + "user:pass":"r00t:pa55" + }; + +Do (around first colon): + vip\*: + +Expect javascript: + var jdbc = { + // JDBC driver for MySQL database: + driver: "com.mysql.jdbc.Driver", + /* JDBC URL for the connection (jdbc:mysql://HOSTNAME/DATABASE) */ + url: 'jdbc:mysql://localhost/test', + database: "test", + "user:pass": "r00t:pa55" + }; + +Do (around first colon, do not ignore comments and strings): + vip\\*: + +Expect javascript: + var jdbc = { + // JDBC driver for MySQL database: + driver: "com.mysql.jdbc.Driver", + /* JDBC URL for the connection (jdbc: mysql: //HOSTNAME/DATABASE) */ + url: 'jdbc: mysql: //localhost/test', + database: "test", + "user: pass": "r00t: pa55" + }; + +Do (do not ignore comments and strings, do not ignore unmatched): + vip\\\*: + +Expect javascript: + var jdbc = { + // JDBC driver for MySQL database: + driver: "com.mysql.jdbc.Driver", + /* JDBC URL for the connection (jdbc: mysql: //HOSTNAME/DATABASE) */ + url: 'jdbc: mysql: //localhost/test', + database: "test", + "user: pass": "r00t: pa55" + }; + +Expect javascript: + var jdbc = { + // JDBC driver for MySQL database: + driver: "com.mysql.jdbc.Driver", + /* JDBC URL for the connection (jdbc:mysql://HOSTNAME/DATABASE) */ + url: 'jdbc:mysql://localhost/test', + database: "test", + "user:pass":"r00t:pa55" + }; + +########################################################### + +Given (table): + | Option| Type | Default | Description | + |--|--|--|--| + | threads | Fixnum | 1 | number of threads in the thread pool | + |queues |Fixnum | 1 | number of concurrent queues | + |queue_size | Fixnum | 1000 | size of each queue | + | interval | Numeric | 0 | dispatcher interval for batch processing | + |batch | Boolean | false | enables batch processing mode | + |batch_size | Fixnum | nil | number of maximum items to be assigned at once | + |logger | Logger | nil | logger instance for debug logs | + +Do (around all |): + vip\*| + +Expect: + | Option | Type | Default | Description | + | -- | -- | -- | -- | + | threads | Fixnum | 1 | number of threads in the thread pool | + | queues | Fixnum | 1 | number of concurrent queues | + | queue_size | Fixnum | 1000 | size of each queue | + | interval | Numeric | 0 | dispatcher interval for batch processing | + | batch | Boolean | false | enables batch processing mode | + | batch_size | Fixnum | nil | number of maximum items to be assigned at once | + | logger | Logger | nil | logger instance for debug logs | + +Do (around all |, and right-align 3rd and center-align the last): + vip\*| + gv\\3| + gv\\\-| + +Expect: + | Option | Type | Default | Description | + | -- | -- | -- | -- | + | threads | Fixnum | 1 | number of threads in the thread pool | + | queues | Fixnum | 1 | number of concurrent queues | + | queue_size | Fixnum | 1000 | size of each queue | + | interval | Numeric | 0 | dispatcher interval for batch processing | + | batch | Boolean | false | enables batch processing mode | + | batch_size | Fixnum | nil | number of maximum items to be assigned at once | + | logger | Logger | nil | logger instance for debug logs | + +Do (Left-right alternating alignment): + vip\**| + +Expect: + | Option | Type | Default | Description | + | -- | -- | -- | -- | + | threads | Fixnum | 1 | number of threads in the thread pool | + | queues | Fixnum | 1 | number of concurrent queues | + | queue_size | Fixnum | 1000 | size of each queue | + | interval | Numeric | 0 | dispatcher interval for batch processing | + | batch | Boolean | false | enables batch processing mode | + | batch_size | Fixnum | nil | number of maximum items to be assigned at once | + | logger | Logger | nil | logger instance for debug logs | + +Do (Right-left alternating alignment): + vip\\**| + +Expect: + | Option | Type | Default | Description | + | -- | -- | -- | -- | + | threads | Fixnum | 1 | number of threads in the thread pool | + | queues | Fixnum | 1 | number of concurrent queues | + | queue_size | Fixnum | 1000 | size of each queue | + | interval | Numeric | 0 | dispatcher interval for batch processing | + | batch | Boolean | false | enables batch processing mode | + | batch_size | Fixnum | nil | number of maximum items to be assigned at once | + | logger | Logger | nil | logger instance for debug logs | + +Do (Right-left alternating alignment, indent: deep): + vip\\**\\| + +Expect: + | Option | Type | Default | Description | + | -- | -- | -- | -- | + | threads | Fixnum | 1 | number of threads in the thread pool | + | queues | Fixnum | 1 | number of concurrent queues | + | queue_size | Fixnum | 1000 | size of each queue | + | interval | Numeric | 0 | dispatcher interval for batch processing | + | batch | Boolean | false | enables batch processing mode | + | batch_size | Fixnum | nil | number of maximum items to be assigned at once | + | logger | Logger | nil | logger instance for debug logs | + +# Doesn't work. Why? +# Do (Repeat the last command): +# :%\=g:easy_align_last_command\\ + +Execute (Repeat the last command): + execute '%'.g:easy_align_last_command + +Expect: + | Option | Type | Default | Description | + | -- | -- | -- | -- | + | threads | Fixnum | 1 | number of threads in the thread pool | + | queues | Fixnum | 1 | number of concurrent queues | + | queue_size | Fixnum | 1000 | size of each queue | + | interval | Numeric | 0 | dispatcher interval for batch processing | + | batch | Boolean | false | enables batch processing mode | + | batch_size | Fixnum | nil | number of maximum items to be assigned at once | + | logger | Logger | nil | logger instance for debug logs | + +Do (around all | with no margin, right-align 2nd to last): + vip\\0\\0\*| + vip\\\0\\0\-2| + +Expect: + |Option |Type |Default|Description | + |-- |-- | --|-- | + |threads |Fixnum | 1|number of threads in the thread pool | + |queues |Fixnum | 1|number of concurrent queues | + |queue_size|Fixnum | 1000|size of each queue | + |interval |Numeric| 0|dispatcher interval for batch processing | + |batch |Boolean| false|enables batch processing mode | + |batch_size|Fixnum | nil|number of maximum items to be assigned at once| + |logger |Logger | nil|logger instance for debug logs | + +########################################################### + +Given (comma-separated items): + aaa, bb,c + d,eeeeeee + fffff, gggggggggg, + h, , ii + j,,k + +Do (around all commas): + vip\*, + +Expect: + aaa, bb, c + d, eeeeeee + fffff, gggggggggg, + h, , ii + j, , k + From 247f69bf3f3d457805fa4afffb69330445cf5d1a Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Wed, 9 Oct 2013 20:39:17 +0900 Subject: [PATCH 2/5] Migrate more test cases to Vader --- test/easy-align.vader | 62 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/test/easy-align.vader b/test/easy-align.vader index 4e29b36..17b652b 100644 --- a/test/easy-align.vader +++ b/test/easy-align.vader @@ -181,7 +181,7 @@ Given javascript (json): "user:pass":"r00t:pa55" }; -Do (around first colon): +Do (around colons): vip\*: Expect javascript: @@ -194,6 +194,19 @@ Expect javascript: "user:pass": "r00t:pa55" }; +Do (around colons, do not stick to left): + vip\*\: + +Expect javascript: + var jdbc = { + // JDBC driver for MySQL database: + driver : "com.mysql.jdbc.Driver", + /* JDBC URL for the connection (jdbc:mysql://HOSTNAME/DATABASE) */ + url : 'jdbc:mysql://localhost/test', + database : "test", + "user:pass" : "r00t:pa55" + }; + Do (around first colon, do not ignore comments and strings): vip\\*: @@ -367,3 +380,50 @@ Expect: h, , ii j, , k +Do (around all commas, do not stick to left): + vip\\*, + +Expect: + aaa , bb , c + d , eeeeeee + fffff , gggggggggg , + h , , ii + j , , k + +Do (center-align around all commas): + vip\\\*, + +Expect: + aaa, bb, c + d, eeeeeee + fffff, gggggggggg, + h, , ii + j, , k + +########################################################### + +Given ruby (multi-line ruby Hash): + options = { :caching => nil, + :versions => 3, + "cache=blocks" => false }.merge(options) + +Do (around the last =): + vip\-= + +Expect ruby: + options = { :caching => nil, + :versions => 3, + "cache=blocks" => false }.merge(options) + +Do (partial alignment): + f: + \jj3E + \\= + +Expect ruby: + options = { :caching => nil, + :versions => 3, + "cache=blocks" => false }.merge(options) + +########################################################### + From 7019edb08c63d16e5019b2f51c29eec3165df01d Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Wed, 9 Oct 2013 22:11:03 +0900 Subject: [PATCH 3/5] More test cases on Vader --- test/easy-align.vader | 663 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 661 insertions(+), 2 deletions(-) diff --git a/test/easy-align.vader b/test/easy-align.vader index 17b652b..67196aa 100644 --- a/test/easy-align.vader +++ b/test/easy-align.vader @@ -1,11 +1,108 @@ -Execute: - silent! unlet g:easy_align_delimiters +Execute (Clean up test environment): + " TODO: revert after test silent! unlet g:easy_align_ignore_groups silent! unlet g:easy_align_ignore_unmatched silent! unlet g:easy_align_indentation silent! unlet g:easy_align_delimiter_align + silent! unlet g:easy_align_interactive_modes + + let g:easy_align_delimiters = {} vnoremap :EasyAlign +########################################################### + +Given (space-separated columns): + 1 22222 33 444 555 6666 7 888 + 11 222 3333 4 55 6666 77 888 + 111 22 333 444 55555 6666 7 88888 + 1111 2 33 444 555 66 777 8 + +Do (left-align): + vip + \ + *\ + +Expect: + 1 22222 33 444 555 6666 7 888 + 11 222 3333 4 55 6666 77 888 + 111 22 333 444 55555 6666 7 88888 + 1111 2 33 444 555 66 777 8 + +Do (right-align): + vip + \\ + *\ + +Expect: + 1 22222 33 444 555 6666 7 888 + 11 222 3333 4 55 6666 77 888 + 111 22 333 444 55555 6666 7 88888 + 1111 2 33 444 555 66 777 8 + +Do (center-align): + vip + \\\ + *\ + +Expect: + 1 22222 33 444 555 6666 7 888 + 11 222 3333 4 55 6666 77 888 + 111 22 333 444 55555 6666 7 88888 + 1111 2 33 444 555 66 777 8 + +Given (comma-separated columns): + a,,bbb + aa,,bb + aaa,,b + aaaa,, + aaa,b, + aa,bb, + a,bbb, + +Do (left-align): + vip + \ + *, + +Expect: + a, , bbb + aa, , bb + aaa, , b + aaaa, , + aaa, b, + aa, bb, + a, bbb, + +Do (right-align): + vip + \\ + *, + +Expect: + a, , bbb + aa, , bb + aaa, , b + aaaa, , + aaa, b, + aa, bb, + a, bbb, + +Do (center-align): + vip + \\\ + *, + +Expect: + a, , bbb + aa, , bb + aaa, , b + aaaa, , + aaa, b, + aa, bb, + a, bbb, + +########################################################### + Given (the beatles): Paul McCartney 1942 George Harrison 1943mmdd @@ -427,3 +524,565 @@ Expect ruby: ########################################################### +Given c (C code with comments 1): + /* a */ b = c + aa >= bb + // aaa = bbb = cccc + /* aaaa = */ bbbb === cccc " = dddd = " = eeee + aaaaa /* bbbbb */ == ccccc /* != eeeee = */ === fffff + +Do: + vip\*= + +Expect c: + /* a */ b = c + aa >= bb + // aaa = bbb = cccc + /* aaaa = */ bbbb === cccc " = dddd = " = eeee + aaaaa /* bbbbb */ == ccccc /* != eeeee = */ === fffff + +Do: + vip\\\*= + +Expect c: + /* a */ b = c + aa >= bb + // aaa = bbb = cccc + /* aaaa = */ bbbb === cccc " = dddd = " = eeee + aaaaa /* bbbbb */ == ccccc /* != eeeee = */ === fffff + +########################################################### + +Given c (C code with comments 2): + int a = 1; + long b = 2; + float c = 3; + string d = 4; + // this line should not get aligned + long int e = 5; + std::map f; + std::map g; /* this? */ + short h /* how about this? */ = 6; + string i = "asdf"; + +Do (around =): + vip\= + +Expect c: + int a = 1; + long b = 2; + float c = 3; + string d = 4; + // this line should not get aligned + long int e = 5; + std::map f; + std::map g; /* this? */ + short h /* how about this? */ = 6; + string i = "asdf"; + +Do (right-align around =, comment lines are ignored): + vip\\= + +Expect c: + int a = 1; + long b = 2; + float c = 3; + string d = 4; + // this line should not get aligned + long int e = 5; + std::map f; + std::map g; /* this? */ + short h /* how about this? */ = 6; + string i = "asdf"; + +Do (right-align around =, do not ignore comment lines): + vip\\\= + +Expect c: + int a = 1; + long b = 2; + float c = 3; + string d = 4; + // this line should not get aligned + long int e = 5; + std::map f; + std::map g; /* this? */ + short h /* how about this? */ = 6; + string i = "asdf"; + +########################################################### + +Given ruby (= operators): + a = + a = 1 + bbbb .= 2 + ccccccc = 3 + ccccccccccccccc + ddd = # + eeee === eee = eee = eee=f + fff = ggg += gg &&= gg + g != hhhhhhhh == # 8 + i := 5 + i %= 5 + i *= 5 + j =~ 5 + j >= 5 + aa => 123 + aa <<= 123 + aa >>= 123 + bbb => 123 + c => 1233123 + d => 123 + dddddd &&= 123 + dddddd ||= 123 + dddddd /= 123 + gg <=> ee + +Do (1st =): + vip\= + +Expect ruby: + a = + a = 1 + bbbb .= 2 + ccccccc = 3 + ccccccccccccccc + ddd = # + eeee === eee = eee = eee=f + fff = ggg += gg &&= gg + g != hhhhhhhh == # 8 + i := 5 + i %= 5 + i *= 5 + j =~ 5 + j >= 5 + aa => 123 + aa <<= 123 + aa >>= 123 + bbb => 123 + c => 1233123 + d => 123 + dddddd &&= 123 + dddddd ||= 123 + dddddd /= 123 + gg <=> ee + +Do (LR =): + vip\**= + +Expect ruby: + a = + a = 1 + bbbb .= 2 + ccccccc = 3 + ccccccccccccccc + ddd = # + eeee === eee = eee = eee = f + fff = ggg += gg &&= gg + g != hhhhhhhh == # 8 + i := 5 + i %= 5 + i *= 5 + j =~ 5 + j >= 5 + aa => 123 + aa <<= 123 + aa >>= 123 + bbb => 123 + c => 1233123 + d => 123 + dddddd &&= 123 + dddddd ||= 123 + dddddd /= 123 + gg <=> ee + +Do (Alignment using mode_sequence, delimiter_align): + vip\\\cr*\\= + +Expect ruby: + a = + a = 1 + bbbb .= 2 + ccccccc = 3 + ccccccccccccccc + ddd = # + eeee === eee = eee = eee = f + fff = ggg += gg &&= gg + g != hhhhhhhh == # 8 + i := 5 + i %= 5 + i *= 5 + j =~ 5 + j >= 5 + aa => 123 + aa <<= 123 + aa >>= 123 + bbb => 123 + c => 1233123 + d => 123 + dddddd &&= 123 + dddddd ||= 123 + dddddd /= 123 + gg <=> ee + +Do (mode_sequence starting from 2nd, delimiter_align = center): + vip\\\rc**\\\2= + +Expect ruby: + a = + a = 1 + bbbb .= 2 + ccccccc = 3 + ccccccccccccccc + ddd = # + eeee === eee = eee = eee = f + fff = ggg += gg &&= gg + g != hhhhhhhh == # 8 + i := 5 + i %= 5 + i *= 5 + j =~ 5 + j >= 5 + aa => 123 + aa <<= 123 + aa >>= 123 + bbb => 123 + c => 1233123 + d => 123 + dddddd &&= 123 + dddddd ||= 123 + dddddd /= 123 + gg <=> ee + +Do (around all =s, do not ignore unmatched): + vip\\ + \0\ + \0\ + \\ + *= + +Expect ruby: + a = + a = 1 + bbbb .= 2 + ccccccc = 3 + ccccccccccccccc + ddd = # + eeee ===eee = eee = eee=f + fff = ggg +=gg &&=gg + g != hhhhhhhh==# 8 + i := 5 + i %= 5 + i *= 5 + j =~ 5 + j >= 5 + aa => 123 + aa <<=123 + aa >>=123 + bbb => 123 + c => 1233123 + d => 123 + dddddd &&=123 + dddddd ||=123 + dddddd /= 123 + gg <=>ee + +Do (1st =): + vip\\\2= + +Expect ruby: + a = + a = 1 + bbbb .= 2 + ccccccc = 3 + ccccccccccccccc + ddd = # + eeee === eee = eee = eee=f + fff = ggg += gg &&= gg + g != hhhhhhhh == # 8 + i := 5 + i %= 5 + i *= 5 + j =~ 5 + j >= 5 + aa => 123 + aa <<= 123 + aa >>= 123 + bbb => 123 + c => 1233123 + d => 123 + dddddd &&= 123 + dddddd ||= 123 + dddddd /= 123 + gg <=> ee + +########################################################### + +Given ruby (Trailing ruby line comment): + apple = 1 # comment not aligned + apricot = 'DAD' + 'F#AD' + banana = 'Gros Michel' ## comment 2 + +Do (around the last spaces): + vip\-\ + +Expect ruby: + apple = 1 # comment not aligned + apricot = 'DAD' + 'F#AD' + banana = 'Gros Michel' ## comment 2 + +Execute (define # rule): + let g:easy_align_delimiters = + \ { '#': { 'pattern': '#\+', 'ignores': ['String'], 'delimiter_align': 'l' } } + +Do (using # rule): + vip\\# + +Expect ruby: + apple = 1 # comment not aligned + apricot = 'DAD' + 'F#AD' + banana = 'Gros Michel' ## comment 2 + +Do (using regular expression): + vip\= + gv\ + \\\ + \ + \#\+\ + +Expect ruby: + apple = 1 # comment not aligned + apricot = 'DAD' + 'F#AD' + banana = 'Gros Michel' ## comment 2 + +########################################################### + +Given (method chain): + my_object + .method1.chain + .second_method.call + .third.call + .method_4.execute + +Do (around all .): + vip\*. + +Expect: + my_object + .method1 .chain + .second_method.call + .third .call + .method_4 .execute + +Do (around all . with deep indentation): + vip\\\*. + +Expect: + my_object + .method1 .chain + .second_method.call + .third .call + .method_4 .execute + +Do (right-align around all .): + vip\\*. + +Expect: + my_object + . method1. chain + .second_method. call + . third. call + . method_4.execute + +########################################################### + +Execute (define d rule): + let g:easy_align_delimiters.d = + \ { 'pattern': '\s\+\(\S\+\s*[;=]\)\@=', 'left_margin': 0, 'right_margin': 0 } + +Given c (complex var dec): + const char* str = "Hello"; + int64_t count = 1 + 2; + static double pi = 3.14; + static std::map* scores = pointer; + +Do (using d rule): + vip\d + gv\= + +Expect c: + const char* str = "Hello"; + int64_t count = 1 + 2; + static double pi = 3.14; + static std::map* scores = pointer; + +########################################################### + +Given (indented code): + apple = 1 + banana = 2 + cake = 3 + daisy = 4 + eggplant = 5 + +Do: + vip\= + +Expect: + apple = 1 + banana = 2 + cake = 3 + daisy = 4 + eggplant = 5 + +Do (shallow indentation): + vip\\= + +Expect: + apple = 1 + banana = 2 + cake = 3 + daisy = 4 + eggplant = 5 + +Do (deep indentation): + vip\\\= + +Expect: + apple = 1 + banana = 2 + cake = 3 + daisy = 4 + eggplant = 5 + +Do (no indentation): + vip\\\\= + +Expect: + apple = 1 + banana = 2 + cake = 3 + daisy = 4 + eggplant = 5 + +Do (right-align, shallow indentation): + vip\\\= + +Expect: + apple = 1 + banana = 2 + cake = 3 + daisy = 4 + eggplant = 5 + +Do (center-align, shallow indentation): + vip\\\\= + +Expect: + apple = 1 + banana = 2 + cake = 3 + daisy = 4 + eggplant = 5 + +Do (right-align, deep indentation): + vip\\\\= + +Expect: + apple = 1 + banana = 2 + cake = 3 + daisy = 4 + eggplant = 5 + +Do (center-align, deep indentation): + vip\\\\\= + +Expect: + apple = 1 + banana = 2 + cake = 3 + daisy = 4 + eggplant = 5 + +Do (right-align, no indentation): + vip\\\\\= + +########################################################### + +Expect: + apple = 1 + banana = 2 + cake = 3 + daisy = 4 + eggplant = 5 + +Given (Center-align cases): + aaaa = 123456778901234567890 = + cccccccccccccc = 12345678 = + + aaaa = 123456778901234567890 = + bbbbbb = 4 + cccccccccccccccccc = 12345678 = + + aaaa = 123456778901234567890 = + cccccccccccccccccc = 12345678 = + + aaaaa = 123456778901234567890 = + cc = 12345678 = + + aaaaa = 123456778901234567890 = + bbbbbbbbbb = 12345 = + + aaaaa = 123456778901234567890 = + cccccccccccccccccc = 123 = + + aaaaa = 123456778901234567890 = + cccccccccccccccccc = 12345678 = + + aaaaa = 12345 = + bbbbbbbbbb = 123456778901234567890 = + + aaaaa = 12345 + bbbbbbbbbb = 123456778901234567890 + +Do: + vip\\\= + }jvip\\\= + }jvip\\\= + }jvip\\\= + }jvip\\\2= + }jvip\\\2= + }jvip\\\2= + }jvip\\\2= + }jvip\\\2= + +Expect: + aaaa = 123456778901234567890 = + cccccccccccccc = 12345678 = + + aaaa = 123456778901234567890 = + bbbbbb = 4 + cccccccccccccccccc = 12345678 = + + aaaa = 123456778901234567890 = + cccccccccccccccccc = 12345678 = + + aaaaa = 123456778901234567890 = + cc = 12345678 = + + aaaaa = 123456778901234567890 = + bbbbbbbbbb = 12345 = + + aaaaa = 123456778901234567890 = + cccccccccccccccccc = 123 = + + aaaaa = 123456778901234567890 = + cccccccccccccccccc = 12345678 = + + aaaaa = 12345 = + bbbbbbbbbb = 123456778901234567890 = + + aaaaa = 12345 + bbbbbbbbbb = 123456778901234567890 + From 9951cad2d0599d52bfcfb76a3997c97b804f48c2 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Wed, 9 Oct 2013 22:18:38 +0900 Subject: [PATCH 4/5] Rename README --- test/{READMD.md => README.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename test/{READMD.md => README.md} (100%) diff --git a/test/READMD.md b/test/README.md similarity index 100% rename from test/READMD.md rename to test/README.md From aa42666f10b8239f37ac97fffac635190dcbf4f7 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Wed, 9 Oct 2013 23:35:35 +0900 Subject: [PATCH 5/5] Remove recording-based test for interactive mode --- test/basic.expected | 1075 ------------------ test/basic.md | 273 ----- test/basic.script | 1 - test/commandline.vader | 157 +++ test/{easy-align.vader => interactive.vader} | 159 ++- test/regexp.expected | 128 --- test/regexp.md | 12 - test/regexp.script | 1 - test/run.vim | 51 - 9 files changed, 311 insertions(+), 1546 deletions(-) delete mode 100644 test/basic.expected delete mode 100644 test/basic.md delete mode 100644 test/basic.script create mode 100644 test/commandline.vader rename test/{easy-align.vader => interactive.vader} (89%) delete mode 100644 test/regexp.expected delete mode 100644 test/regexp.md delete mode 100644 test/regexp.script delete mode 100644 test/run.vim diff --git a/test/basic.expected b/test/basic.expected deleted file mode 100644 index 232486e..0000000 --- a/test/basic.expected +++ /dev/null @@ -1,1075 +0,0 @@ -" :source run.vim -" @a - -Pa ul Mc Ca rt ne y{ {1 }} 94 2 -Ge or ge Ha rr is on {{ 1} }9 43 -Ri ng o St ar r {{ 1} }9 40 -Pe te Be st {{ 1} }9 41 - - Paul McCartney{{1}}942 -George Harrison {{1}}943 - Ringo Starr {{1}}940 - Pete Best {{1}}941 - - Paul McCartney 1942 -George Harrison 1943 - Ringo Starr 1940 - Pete Best 1941 - -Paul McCartney 1942 -George Harrison 1943 -Ringo Starr 1940 -Pete Best 1941 - -Paul McCartney 1942 -George Harrison 1943 -Ringo Starr 1940 -Pete Best 1941 - -Paul McCartney 1942 -George Harrison 1943 -Ringo Starr 1940 -Pete Best 1941 - -Paul McCartney 1942 -George Harrison 1943 -Ringo Starr 1940 -Pete Best 1941 - - Paul McCartney 1942 -George Harrison 1943 - Ringo Starr 1940 - Pete Best 1941 - -Paul McCartney 1942 -George Harrison 1943 -Ringo Starr 1940 -Pete Best 1941 - - Paul McCartney 1942 -George Harrison 1943 - Ringo Starr 1940 - Pete Best 1941 - -Paul McCartney 1942 -George Harrison 1943 -Ringo Starr 1940 -Pete Best 1941 - -Paul McCartney 1942 -George Harrison 1943 -Ringo Starr 1940 -Pete Best 1941 - -Paul McCartney 1942 -George Harrison 1943 -Ringo Starr 1940 -Pete Best 1941 - -| Option | Type | Default | Description | -| -- | -- | -- | -- | -| threads | Fixnum | 1 | number of threads in the thread pool | -| queues | Fixnum | 1 | number of concurrent queues | -| queue_size | Fixnum | 1000 | size of each queue | -| interval | Numeric | 0 | dispatcher interval for batch processing | -| batch | Boolean | false | enables batch processing mode | -| batch_size | Fixnum | nil | number of maximum items to be assigned at once | -| logger | Logger | nil | logger instance for debug logs | - -| Option | Type | Default | Description | -| -- | -- | -- | -- | -| threads | Fixnum | 1 | number of threads in the thread pool | -| queues | Fixnum | 1 | number of concurrent queues | -| queue_size | Fixnum | 1000 | size of each queue | -| interval | Numeric | 0 | dispatcher interval for batch processing | -| batch | Boolean | false | enables batch processing mode | -| batch_size | Fixnum | nil | number of maximum items to be assigned at once | -| logger | Logger | nil | logger instance for debug logs | - -| Option | Type | Default | Description | -| -- | -- | -- | -- | -| threads | Fixnum | 1 | number of threads in the thread pool | -| queues | Fixnum | 1 | number of concurrent queues | -| queue_size | Fixnum | 1000 | size of each queue | -| interval | Numeric | 0 | dispatcher interval for batch processing | -| batch | Boolean | false | enables batch processing mode | -| batch_size | Fixnum | nil | number of maximum items to be assigned at once | -| logger | Logger | nil | logger instance for debug logs | - -aaa, bb, c -d, eeeeeee -fffff, gggggggggg, -h, , ii -j, , k - -```ruby - - a = - a = 1 - bbbb .= 2 - ccccccc = 3 -ccccccccccccccc - ddd = # - eeee === eee = eee = eee = f - fff = ggg += gg &&= gg - g != hhhhhhhh == # 8 - i := 5 - i %= 5 - i *= 5 - j =~ 5 - j >= 5 - aa => 123 - aa <<= 123 - aa >>= 123 - bbb => 123 - c => 1233123 - d => 123 - dddddd &&= 123 - dddddd ||= 123 - dddddd /= 123 - gg <=> ee - -a = -a = 1 -bbbb .= 2 -ccccccc = 3 -ccccccccccccccc -ddd = # -eeee === eee = eee = eee = f -fff = ggg += gg &&= gg -g != hhhhhhhh == # 8 -i := 5 -i %= 5 -i *= 5 -j =~ 5 -j >= 5 -aa => 123 -aa <<= 123 -aa >>= 123 -bbb => 123 -c => 1233123 -d => 123 -dddddd &&= 123 -dddddd ||= 123 -dddddd /= 123 -gg <=> ee - - a = - a = 1 - bbbb .= 2 - ccccccc = 3 -ccccccccccccccc - ddd = # - eeee === eee = eee = eee=f - fff = ggg += gg &&= gg - g != hhhhhhhh == # 8 - i := 5 - i %= 5 - i *= 5 - j =~ 5 - j >= 5 - aa => 123 - aa <<= 123 - aa >>= 123 - bbb => 123 - c => 1233123 - d => 123 - dddddd &&= 123 - dddddd ||= 123 - dddddd /= 123 - gg <=> ee - -a = -a = 1 -bbbb .= 2 -ccccccc = 3 -ccccccccccccccc -ddd = # -eeee === eee = eee = eee = f -fff = ggg += gg &&= gg -g != hhhhhhhh == # 8 -i := 5 -i %= 5 -i *= 5 -j =~ 5 -j >= 5 -aa => 123 -aa <<= 123 -aa >>= 123 -bbb => 123 -c => 1233123 -d => 123 -dddddd &&= 123 -dddddd ||= 123 -dddddd /= 123 -gg <=> ee - -a = -a = 1 -bbbb .= 2 -ccccccc = 3 -ccccccccccccccc -ddd = # -eeee === eee = eee = eee = f -fff = ggg += gg &&= gg -g != hhhhhhhh == # 8 -i := 5 -i %= 5 -i *= 5 -j =~ 5 -j >= 5 -aa => 123 -aa <<= 123 -aa >>= 123 -bbb => 123 -c => 1233123 -d => 123 -dddddd &&= 123 -dddddd ||= 123 -dddddd /= 123 -gg <=> ee - -a = -a = 1 -bbbb .= 2 -ccccccc = 3 -ccccccccccccccc -ddd = # -eeee === eee = eee = eee=f -fff = ggg += gg &&= gg -g != hhhhhhhh == # 8 -i := 5 -i %= 5 -i *= 5 -j =~ 5 -j >= 5 -aa => 123 -aa <<= 123 -aa >>= 123 -bbb => 123 -c => 1233123 -d => 123 -dddddd &&= 123 -dddddd ||= 123 -dddddd /= 123 -gg <=> ee - -options = { :caching => nil, - :versions => 3, - "cache=blocks" => false }.merge(options) - -options = { :caching => nil, - :versions => 3, - "cache=blocks" => false }.merge(options) - -options = { :caching => nil, - :versions => 3, - "cache=blocks" => false }.merge(options) - -apple = 1 # comment not aligned -banana = 'Gros Michel' # comment 2 - -# let g:easy_align_delimiters = { '#': { 'pattern': '#\+', 'ignores': ['String'] } } - -apple = 1 # comment not aligned -apricot = 'DAD' + 'F#AD' -banana = 'Gros Michel' # comment 2 - -apple = 1 # comment not aligned -apricot = 'DAD' + 'F#AD' -banana = 'Gros Michel' # comment 2 - -``` - -```yaml - - mysql: - # JDBC driver for MySQL database: - driver: com.mysql.jdbc.Driver - # JDBC URL for the connection (jdbc:mysql://HOSTNAME/DATABASE) - url: jdbc:mysql://localhost/test - database: test - "user:pass": r00t:pa55 - -mysql: - # JDBC driver for MySQL database: - driver: com.mysql.jdbc.Driver - # JDBC URL for the connection (jdbc:mysql://HOSTNAME/DATABASE) - url: jdbc:mysql://localhost/test - database: test - "user:pass": r00t:pa55 - -``` -```c - -/* a */ b = c -aa >= bb -// aaa = bbb = cccc -/* aaaa = */ bbbb === cccc " = dddd = " = eeee -aaaaa /* bbbbb */ == ccccc /* != eeeee = */ === fffff - -/* a */ b = c -aa >= bb -// aaa = bbb = cccc -/* aaaa = */ bbbb === cccc " = dddd = " = eeee -aaaaa /* bbbbb */ == ccccc /* != eeeee = */ === fffff - -``` - -my_object - .method1 .chain - .second_method.call - .third .call - .method_4 .execute - -my_object - .method1 . chain - .second_method. call - .third . call - .method_4 .execute - -my_object - . method1.chain - .second_method.call - . third.call - . method_4.execute - -my_object - . method1.chain - .second_method.call - . third.call - . method_4.execute - -my_object - . method1. chain - .second_method. call - . third. call - . method_4.execute - -my_object - .method1 .chain - .second_method.call - .third .call - .method_4 .execute - -my_object - .method1.chain - .second_method.call - .third.call - .method_4.execute - -my_object . - method1 .chain. - second_method.call. - third .call. - method_4 .execute - - | Option | Type | Default | Description | - | -- | -- | -- | -- | - | threads | Fixnum | 1 | number of threads in the thread pool | - | queues | Fixnum | 1 | number of concurrent queues | - | queue_size | Fixnum | 1000 | size of each queue | - | interval | Numeric | 0 | dispatcher interval for batch processing | - | batch | Boolean | false | enables batch processing mode | - | batch_size | Fixnum | nil | number of maximum items to be assigned at once | - | logger | Logger | nil | logger instance for debug logs | - - | Option | Type | Default | Description | - | -- | -- | -- | -- | - | threads | Fixnum | 1 | number of threads in the thread pool | - | queues | Fixnum | 1 | number of concurrent queues | - | queue_size | Fixnum | 1000 | size of each queue | - | interval | Numeric | 0 | dispatcher interval for batch processing | - | batch | Boolean | false | enables batch processing mode | - | batch_size | Fixnum | nil | number of maximum items to be assigned at once | - | logger | Logger | nil | logger instance for debug logs | - - | Option | Type | Default | Description | - | -- | -- | -- | -- | - | threads | Fixnum | 1 | number of threads in the thread pool | - | queues | Fixnum | 1 | number of concurrent queues | - | queue_size | Fixnum | 1000 | size of each queue | - | interval | Numeric | 0 | dispatcher interval for batch processing | - | batch | Boolean | false | enables batch processing mode | - | batch_size | Fixnum | nil | number of maximum items to be assigned at once | - | logger | Logger | nil | logger instance for debug logs | - - - |Option |Type |Default |Description | - |-- |-- |-- |-- | - |threads |Fixnum |1 |number of threads in the thread pool | - |queues |Fixnum |1 |number of concurrent queues | - |queue_size |Fixnum |1000 |size of each queue | - |interval |Numeric |0 |dispatcher interval for batch processing | - |batch |Boolean |false |enables batch processing mode | - |batch_size |Fixnum |nil |number of maximum items to be assigned at once | - |logger |Logger |nil |logger instance for debug logs | - - | Option ~| Type ~| Default~| Description ~| - | -- ~| -- ~| -- ~| -- ~| - | threads ~| Fixnum ~| 1 ~| number of threads in the thread pool ~| - | queues ~| Fixnum ~| 1 ~| number of concurrent queues ~| - | queue_size~| Fixnum ~| 1000 ~| size of each queue ~| - | interval ~| Numeric~| 0 ~| dispatcher interval for batch processing ~| - | batch ~| Boolean~| false ~| enables batch processing mode ~| - | batch_size~| Fixnum ~| nil ~| number of maximum items to be assigned at once~| - | logger ~| Logger ~| nil ~| logger instance for debug logs ~| - -```c - -const char* str = "Hello"; -int64_t count = 1 + 2; -static double pi = 3.14; -static std::map* scores = pointer; - -``` - - Paul@@@ McCartney{{{ 1942 -George@@@ Harrison {{{ 1943 - Ringo@@@ Starr {{{ 1940 - Pete@@@ Best {{{ 1941 - - Paul McCartney 1942 -George Harrison 1943 - Ringo Starr 1940 - Pete Best 1941 - -... - . ----- -.. -- .. ---- -. --- ... --- - ---- .... -- -. --- ..... - -.. -- ...... -... - ..... - - -... - . ----- -.. -- .. ---- -. --- ... --- - ---- .... -- -. --- ..... - -.. -- ...... -... - ..... - - -... - . ----- -.. -- .. ---- -. --- ... --- - ---- .... -- -. --- ..... - -.. -- ...... -... - ..... - - -... - . ----- -.. -- .. ---- -. --- ... --- - ---- .... -- -. --- ..... - -.. -- ...... -... - ..... - - -... - .----- -.. -- ..---- -. --- ...--- - ---- ....-- -. --- .....- -.. -- ...... -... - .....- - -... - . ----- -.. -- .. ---- -. --- ... --- - ---- .... -- -. --- ..... - -.. -- ...... -... - ..... - - -... - .----- -.. -- ..---- -. --- ...--- - ---- ....-- -. --- .....- -.. -- ...... -... - .....- - -... - .----- -.. -- ..---- -. --- ...--- - ---- ....-- -. --- .....- -.. -- ...... -... - .....- - -...-.----- -..--..---- -.---...--- -----....-- -.---.....- -..--...... -...-.....- - -... - . ----- -.. -- .. ---- -. --- ... --- - ---- .... -- -. --- ..... - -.. -- ...... -... - ..... - - -... - .----- -.. -- ..---- -. --- ...--- - ---- ....-- -. --- .....- -.. -- ...... -... - .....- - -... - . ----- -.. -- .. ---- -. --- ... --- - ---- .... -- -. --- ..... - -.. -- ...... -... - ..... - - -... - . ----- -.. -- .. ---- -. --- ... --- - ---- .... -- -. --- ..... - -.. -- ...... -... - ..... - - -...-. ----- -..--.. ---- -.---... --- -----.... -- -.---..... - -..--...... -...-..... - - -... - .----- -.. -- ..---- -. --- ...--- - ---- ....-- -. --- .....- -.. -- ...... -... - .....- - - apple = 1 = 2 - banana = 2 = 2 - cake = 3 = 2 - daisy = 4 = 2 - eggplant = 5 = 2 - - apple = 1 = 2 - banana = 2 = 2 - cake = 3 = 2 - daisy = 4 = 2 -eggplant = 5 = 2 - -apple = 1 = 2 -banana = 2 = 2 -cake = 3 = 2 -daisy = 4 = 2 -eggplant = 5 = 2 - -apple = 1 = 2 -banana = 2 = 2 -cake = 3 = 2 -daisy = 4 = 2 -eggplant = 5 = 2 - - apple = 1 = 2 - banana = 2 = 2 - cake = 3 = 2 - daisy = 4 = 2 - eggplant = 5 = 2 - - apple = 1 = 2 - banana = 2 = 2 - cake = 3 = 2 - daisy = 4 = 2 - eggplant = 5 = 2 - -1 apple = 1 = 2 -1 banana = 2 = 2 -1 cake = 3 = 2 -1 daisy = 4 = 2 -1 eggplant = 5 = 2 - -apple = 1 -banana = 2 -cake = 3 -daisy = 4 -eggplant = 5 - - a pple = 1 - banana = 2 - cake = 3 - daisy = 4 - eggplant = 5 - - apple = 1 - banana = 2 - cake = 3 - daisy = 4 - eggplant = 5 - - apple = 1 = 2 - banana = 2 = 2 - cake = 3 = 2 - daisy = 4 = 2 - eggplant = 5 = 2 - - apple = 1 - banana = 2 - cake = 3 - daisy = 4 - eggplant = 5 - - apple = 1 - banana = 2 - cake = 3 - daisy = 4 - eggplant = 5 - - apple = 1 - banana = 2 - cake = 3 - daisy = 4 - eggplant = 5 - - apple = 1 - banana = 2 - cake = 3 - daisy = 4 - eggplant = 5 - - apple = 1 - banana = 2 - cake = 3 - daisy = 4 - eggplant = 5 - - apple = 1 - banana = 2 - cake = 3 - daisy = 4 - eggplant = 5 - - apple = 1 - banana = 2 - cake = 3 - daisy = 4 - eggplant = 5 - - apple = 1 - banana = 2 - cake = 3 - daisy = 4 - eggplant = 5 - - apple = 1 - banana = 2 - cake = 3 - daisy = 4 - eggplant = 5 - - -```c - - int a = 1; - long b = 2; - float c = 3; - string d = 4; -// this line should not get aligned - long int e = 5; - std::map f; -std::map g; /* this? */ -short h /* how about this? */ = 6; - string i = "asdf"; - -int a = 1; -long b = 2; -float c = 3; -string d = 4; -// this line should not get aligned -long int e = 5; -std::map f; -std::map g; /* this? */ -short h /* how about this? */ = 6; -string i = "asdf"; - -``` - -```ruby - -a = -a = 1 -bbbb .= 2 -ccccccc = 3 - ccccccccccccccc -# eeeeeeeeeeeeeeee -e # asdf -ddd = # -eeee === eee = eee = eee=f -fff = ggg += gg &&= gg -g != hhhhhhhh == # 8 -i := 5 -i %= 5 -i *= 5 -j =~ 5 -j >= 5 -aa => 123 -aa <<= 123 -aa >>= 123 -bbb => 123 -c => 1233123 -d => 123 -dddddd &&= 123 -dddddd ||= 123 -dddddd /= 123 -gg <=> ee - -a = -a = 1 -bbbb .= 2 -ccccccc = 3 -ccccccccccccccc -# eeeeeeeeeeeeeeee -e # asdf -ddd = # -eeee === eee = eee = eee = f -fff = ggg += gg &&= gg -g != hhhhhhhh == # 8 -i := 5 -i %= 5 -i *= 5 -j =~ 5 -j >= 5 -aa => 123 -aa <<= 123 -aa >>= 123 -bbb => 123 -c => 1233123 -d => 123 -dddddd &&= 123 -dddddd ||= 123 -dddddd /= 123 -gg <=> ee - - a = - a = 1 - bbbb .= 2 - ccccccc = 3 -ccccccccccccccc -# eeeeeeeeeeeeeeee -e # asdf - ddd = # - eeee === eee = eee = eee = f - fff = ggg += gg &&= gg - g != hhhhhhhh == # 8 - i := 5 - i %= 5 - i *= 5 - j =~ 5 - j >= 5 - aa => 123 - aa <<= 123 - aa >>= 123 - bbb => 123 - c => 1233123 - d => 123 - dddddd &&= 123 - dddddd ||= 123 - dddddd /= 123 - gg <=> ee - -a = -a = 1 -bbbb .= 2 -ccccccc = 3 -ccccccccccccccc -# eeeeeeeeeeeeeeee -e # asdf -ddd = # -eeee === eee = eee = eee = f -fff = ggg += gg &&= gg -g != hhhhhhhh == # 8 -i := 5 -i %= 5 -i *= 5 -j =~ 5 -j >= 5 -aa => 123 -aa <<= 123 -aa >>= 123 -bbb => 123 -c => 1233123 -d => 123 -dddddd &&= 123 -dddddd ||= 123 -dddddd /= 123 -gg <=> ee - - a = - a = 1 - bbbb .= 2 - ccccccc = 3 -ccccccccccccccc -# eeeeeeeeeeeeeeee -e # asdf - ddd = # - eeee === eee = eee = eee = f - fff = ggg += gg &&= gg - g != hhhhhhhh == # 8 - i := 5 - i %= 5 - i *= 5 - j =~ 5 - j >= 5 - aa => 123 - aa <<= 123 - aa >>= 123 - bbb => 123 - c => 1233123 - d => 123 - dddddd &&= 123 - dddddd ||= 123 - dddddd /= 123 - gg <=> ee - - a = - a = 1 - bbbb .= 2 - ccccccc = 3 -ccccccccccccccc -# eeeeeeeeeeeeeeee -e # asdf - ddd = # - eeee === eee = eee = eee=f - fff = ggg += gg &&= gg - g != hhhhhhhh == # 8 - i := 5 - i %= 5 - i *= 5 - j =~ 5 - j >= 5 - aa => 123 - aa <<= 123 - aa >>= 123 - bbb => 123 - c => 1233123 - d => 123 - dddddd &&= 123 - dddddd ||= 123 - dddddd /= 123 - gg <=> ee - -a = 1 -bb = 22 -ccc = 333 -dddd = "asdf" - -a = 1 -bb = 22 -ccc = 333 -dddd = "asdf" - - a = 1 - bb = 22 - ccc = 333 -dddd = "asdf" - -a = 1 -bb = 22 -ccc = 333 -dddd = "asdf" - - a = 1 - bb = 22 - ccc = 333 -dddd = "asdf" - -a = 1 -bb = 22 -ccc = 333 -dddd = "asdf" - - a = 1 - bb = 22 - ccc = 333 -dddd = "asdf" - -``` - - a a a a a - bbb bbb bbb bbb bbb -ccccc ccccc ccccc ccccc ccccc - d ddd dddd ddd d - -aaaaa = 123456778901234567890 = -bbbbbbbbbb = 12345 = - -aaaaa = 123456778901234567890 = -cccccccccccccccccc = 123 = - -aaaaa = 123456778901234567890 = -cccccccccccccccccc = 12345678 = - -aaaaa = 12345 = -bbbbbbbbbb = 123456778901234567890 = - - aaaaa = 12345 -bbbbbbbbbb = 123456778901234567890 - -123456 789 -1234567890 1 - -1234 56 -123456 7890 - - aaaaa = 123456778901234567890 = - cccccccccccccccccc = 12345678 = - -| Option | Type | Default | Description | -| -- | -- | -- | -- | -| threads | Fixnum | 1 | number of threads in the thread pool | -| queues | Fixnum | 1 | number of concurrent queues | -| queue_size | Fixnum | 1000 | size of each queue | -| interval | Numeric | 0 | dispatcher interval for batch processing | -| batch | Boolean | false | enables batch processing mode | -| batch_size | Fixnum | nil | number of maximum items to be assigned at once | -| logger | Logger | nil | logger instance for debug logs | - -| Option | Type | Default | Description | -| -- | -- | -- | -- | -| threads | Fixnum | 1 | number of threads in the thread pool | -| queues | Fixnum | 1 | number of concurrent queues | -| queue_size | Fixnum | 1000 | size of each queue | -| interval | Numeric | 0 | dispatcher interval for batch processing | -| batch | Boolean | false | enables batch processing mode | -| batch_size | Fixnum | nil | number of maximum items to be assigned at once | -| logger | Logger | nil | logger instance for debug logs | - -| Option | Type | Default | Description | -| -- | -- | -- | -- | -| threads | Fixnum | 1 | number of threads in the thread pool | -| queues | Fixnum | 1 | number of concurrent queues | -| queue_size | Fixnum | 1000 | size of each queue | -| interval | Numeric | 0 | dispatcher interval for batch processing | -| batch | Boolean | false | enables batch processing mode | -| batch_size | Fixnum | nil | number of maximum items to be assigned at once | -| logger | Logger | nil | logger instance for debug logs | - - Option | Type | Default | Description | - -- | -- | -- | -- | - threads | Fixnum | 1 | number of threads in the thread pool | - queues | Fixnum | 1 | number of concurrent queues | -queue_size | Fixnum | 1000 | size of each queue | - interval | Numeric | 0 | dispatcher interval for batch processing | - batch | Boolean | false | enables batch processing mode | -batch_size | Fixnum | nil | number of maximum items to be assigned at once | - logger | Logger | nil | logger instance for debug logs | - -``` - aaaaa = 123456778901234567890 = -cccccccccccccccccc =12345678 = - - aaaa = 123456778901234567890 = - cccccccccccccccccc = 12345678 = - - aaaa = 123456778901234567890 = -cccccccccccccccccc = 12345678 = - - aaaa = 123456778901234567890 = - cccccccccccccccccc = 12345678 = - - aaaa = 123456778901234567890 = - cccccccccccccccccc = 12345678 = - - aaaa = 123456778901234567890 = - cccccccccccccccccc = 12345678 = - - aaaaaaaaaaaaa = 123456778901234567890 = - cc = 12345678 = - - aaaaaaaaaaa = 123 - a = 123 - - aaaaaaaaaaaa = 123 - a = 123 - -aaaaaaaaaaaa = 123 -aaaaaaaaaaa = 123 - aaaaaaaaaa = 123 - aaa = 123 - aa = 123 - a = 123 - - aaaaaaaaaaaa = 123 - aaaaaaaaaaa = 123 - aaaaaaaaaa = 123 - aaa = 123 - aa = 123 - a = 123 - - aaaaaaaaaaaa = 123 - aaaaaaaaaaa = 123 - aaaaaaaaaa = 123 - aaa = 123 - aa = 123 - a = 123 - - aaaa = 123456778901234567890 = - cccccccccccccc = 12345678 = - - aaaa = 123456778901234567890 = - bbbbbb = 4 - cccccccccccccccccc = 12345678 = - - aaaa = 123456778901234567890 = - cccccccccccccccccc = 12345678 = - - aaaaa = 123456778901234567890 = - cc = 12345678 = - -= aaaaa = 123456778901234567890 = -= cccccccccccccccccc = 12345678 = - -=aaaaa = 123456778901234567890 = -= cccccccccccccccccc = 12345678 = - -``` - - a, , bbb - aa, , bb -aaa, , b -aaaa, , -aaa, b, - aa, bb, - a, bbb, - -1 22222 33 444 555 6666 7 888 -11 222 3333 4 55 6666 77 888 -111 22 333 444 55555 6666 7 88888 -1111 2 33 444 555 66 777 8 - -1 22222 33 444 555 6666 7 888 -11 222 3333 4 55 6666 77 888 -111 22 333 444 55555 6666 7 88888 -1111 2 33 444 555 66 777 8 - -1 22222 33 444 555 6666 7 888 -11 222 3333 4 55 6666 77 888 -111 22 333 444 55555 6666 7 88888 -1111 2 33 444 555 66 777 8 - - a = 1 - bb = 2 -ccccc -ddd = 3 - - a = 1 - bb = 2 -ccccc - ddd = 3 diff --git a/test/basic.md b/test/basic.md deleted file mode 100644 index d482ff3..0000000 --- a/test/basic.md +++ /dev/null @@ -1,273 +0,0 @@ -" :source run.vim -" @a - -Paul McCartney 1942 -George Harrison 1943 -Ringo Starr 1940 -Pete Best 1941 - -| Option| Type | Default | Description | -|--|--|--|--| -| threads | Fixnum | 1 | number of threads in the thread pool | -|queues |Fixnum | 1 | number of concurrent queues | -|queue_size | Fixnum | 1000 | size of each queue | -| interval | Numeric | 0 | dispatcher interval for batch processing | -|batch | Boolean | false | enables batch processing mode | - |batch_size | Fixnum | nil | number of maximum items to be assigned at once | - |logger | Logger | nil | logger instance for debug logs | - -aaa, bb,c -d,eeeeeee -fffff, gggggggggg, -h, , ii -j,,k - -```ruby - -a = -a = 1 -bbbb .= 2 -ccccccc = 3 -ccccccccccccccc -ddd = # -eeee === eee = eee = eee=f -fff = ggg += gg &&= gg -g != hhhhhhhh == # 8 -i := 5 -i %= 5 -i *= 5 -j =~ 5 -j >= 5 -aa => 123 -aa <<= 123 -aa >>= 123 -bbb => 123 -c => 1233123 -d => 123 -dddddd &&= 123 -dddddd ||= 123 -dddddd /= 123 -gg <=> ee - -options = { :caching => nil, - :versions => 3, - "cache=blocks" => false }.merge(options) - -apple = 1 # comment not aligned -banana = 'Gros Michel' # comment 2 - -# let g:easy_align_delimiters = { '#': { 'pattern': '#\+', 'ignores': ['String'] } } - -apple = 1 # comment not aligned -apricot = 'DAD' + 'F#AD' -banana = 'Gros Michel' # comment 2 - -``` - -```yaml - -mysql: - # JDBC driver for MySQL database: - driver: com.mysql.jdbc.Driver - # JDBC URL for the connection (jdbc:mysql://HOSTNAME/DATABASE) - url: jdbc:mysql://localhost/test - database: test - "user:pass":r00t:pa55 - -``` -```c - -/* a */ b = c -aa >= bb -// aaa = bbb = cccc -/* aaaa = */ bbbb === cccc " = dddd = " = eeee -aaaaa /* bbbbb */ == ccccc /* != eeeee = */ === fffff - -``` - -my_object - .method1.chain - .second_method.call - .third.call - .method_4.execute - -my_object. - method1.chain. - second_method.call. - third.call. - method_4.execute - - | Option| Type | Default | Description | - |--|--|--|--| - | threads | Fixnum | 1 | number of threads in the thread pool | - |queues |Fixnum | 1 | number of concurrent queues | - |queue_size | Fixnum | 1000 | size of each queue | - | interval | Numeric | 0 | dispatcher interval for batch processing | - |batch | Boolean | false | enables batch processing mode | - |batch_size | Fixnum | nil | number of maximum items to be assigned at once | - |logger | Logger | nil | logger instance for debug logs | - - -```c - -const char* str = "Hello"; -int64_t count = 1 + 2; -static double pi = 3.14; -static std::map* scores = pointer; - -``` - -Paul McCartney 1942 -George Harrison 1943 -Ringo Starr 1940 -Pete Best 1941 - -...-.----- -..--..---- -.---...--- -----....-- -.---.....- -..--...... -...-.....- - - apple = 1 - banana = 2 - cake = 3 - daisy = 4 - eggplant = 5 - - -```c - -int a = 1; -long b = 2; -float c = 3; -string d = 4; -// this line should not get aligned -long int e = 5; -std::map f; -std::map g; /* this? */ -short h /* how about this? */ = 6; -string i = "asdf"; - -``` - -```ruby - -a = -a = 1 -bbbb .= 2 -ccccccc = 3 -ccccccccccccccc -# eeeeeeeeeeeeeeee -e # asdf -ddd = # -eeee === eee = eee = eee=f -fff = ggg += gg &&= gg -g != hhhhhhhh == # 8 -i := 5 -i %= 5 -i *= 5 -j =~ 5 -j >= 5 -aa => 123 -aa <<= 123 -aa >>= 123 -bbb => 123 -c => 1233123 -d => 123 -dddddd &&= 123 -dddddd ||= 123 -dddddd /= 123 -gg <=> ee - -a = 1 -bb = 22 -ccc = 333 -dddd = "asdf" - -``` - -a a a a a -bbb bbb bbb bbb bbb -ccccc ccccc ccccc ccccc ccccc - d ddd dddd ddd d - -aaaaa = 123456778901234567890 = -bbbbbbbbbb = 12345 = - -aaaaa = 123456778901234567890 = -cccccccccccccccccc = 123 = - -aaaaa = 123456778901234567890 = -cccccccccccccccccc = 12345678 = - -aaaaa = 12345 = -bbbbbbbbbb = 123456778901234567890 = - -aaaaa = 12345 -bbbbbbbbbb = 123456778901234567890 - -123456 789 -1234567890 1 - -1234 56 -123456 7890 - - aaaaa = 123456778901234567890 = - cccccccccccccccccc = 12345678 = - -``` - aaaaa = 123456778901234567890 = -cccccccccccccccccc =12345678 = - - aaaa = 123456778901234567890 = - cccccccccccccccccc = 12345678 = - - aaaaaaaaaaaaa = 123456778901234567890 = -cc = 12345678 = - - aaaaaaaaaaa= 123 - a = 123 - - aaaaaaaaaaaa= 123 - a = 123 - - aaaaaaaaaaaa = 123 - aaaaaaaaaaa = 123 - aaaaaaaaaa = 123 - aaa = 123 - aa = 123 - a = 123 - - aaaa = 123456778901234567890 = -cccccccccccccc = 12345678 = - - aaaa = 123456778901234567890 = - bbbbbb = 4 -cccccccccccccccccc = 12345678 = - - aaaa = 123456778901234567890 = - cccccccccccccccccc = 12345678 = - - aaaaa = 123456778901234567890 = - cc = 12345678 = - -=aaaaa = 123456778901234567890 = -= cccccccccccccccccc = 12345678 = - -``` - -a,,bbb -aa,,bb -aaa,,b -aaaa,, -aaa,b, -aa,bb, -a,bbb, - -1 22222 33 444 555 6666 7 888 -11 222 3333 4 55 6666 77 888 -111 22 333 444 55555 6666 7 88888 -1111 2 33 444 555 66 777 8 - diff --git a/test/basic.script b/test/basic.script deleted file mode 100644 index 26a329d..0000000 --- a/test/basic.script +++ /dev/null @@ -1 +0,0 @@ -4Gvipjyvip Pvip 2 Pvip * Pvip Pvip 2 Pvip * Pvip ** Pvip - Pvip -2 Pvip -1 Pvip ** 60zzvipjyvip *|Pvip *|Pvip **|80zzvip **|gv 3|vip *|90zzvip *,100zzvipjyvip =Pvip *=Pvip **=Pvip =vip 2=198Gvipjyvip =Pvip -=Pf:jj3E =209Gvip - 214zzvipjyvip #P:let g:easy_align_delimiters = { '#': {'pattern': '#\+', 'ignore_groups': ['String'] } } vip #227zzvip :239zzvip *=vipjyP:let g:easy_align_ignore_groups = [] vip *=:unlet g:easy_align_delimiters :unlet g:easy_align_ignore_groups 4Gvipy4GP7Gojkkvip:EasyAlign /1/{'ml':'{{', 'mr-r':'}}'} vipjyPvip:EasyAlign */../ 263zzvipjygv .Pvip *.Pvip * .Pvip .vip 2.Pvip **.Pvip **.Pvip -.G303zzvip .310zzvipjygv *|Pvip *|Pvip |gv -|gv **|gv *|gv **|jji jjjhi vip ** |339Gpvip:EasyAlign*|{'ml': 5, 'mrr': 0 } 349Gpvip:EasyAlign*/|/{'ml':'~', 'mrr': 4} 362G:let g:easy_align_delimiters = { 'd': { 'pattern': '\s\+\(\S\+\s*[;=]\)\@=', 'left_margin': 0, 'right_margin': 0 } } vip dgv =236GvipjyPvip :377Gvip gv 2 382Gvipjyvip:EasyAlign/-\+/ Pvip:EasyAlign2/-\+/ Pvip:EasyAlign*/-\+/ Pvip:EasyAlign*/-\+/{'da': L} Pvip:EasyAlign/-\+/{'da': c} Pvip:EasyAlign*/-\+/{'delimiter_align':'C'} Pvip:EasyAlign*/-\+/{'da': 'x'} 381Gpvip:EasyAlign/-\+/{'da':r} :let g:easy_align_delimiter_align = 'l' Pvip:EasyAlign/-\+/ Pvip:EasyAlign*/-\+/ :unlet g:easy_align_delimiter_align :let g:easy_align_delimiters['\'] = { 'pattern': '-\+', 'delimiter_align': 'c' } Pvip \Pvip *-\Pvip:EasyAlign *\\ {'da':l} Pvip:EasyAlign*\\ Pvip:EasyAlign*\\{'da': 'R'} 377GvipjyPvip:EasyAlign\ {'l': '@@@'} gv:EasyAlign 2 \ {'l': '{{{'} 507Gvipjygv:EasyAlign= Pvip:EasyAlign = {'idt': s} Pvip:EasyAlign= {'idt': d} Pvip:EasyAlign**={'indentation': 'd'} Pvip:EasyAlign!= Pvip:EasyAlign! **= {'indent': s} Pvip:EasyAlign!* = {'idt': D} Pvip:EasyAlign! ={'idt':'S'} 507GPvip:EasyAlign-={'idt':d} PA = 2j.j.j.j.vip:EasyAlign2={'idt': s} 507GPljjjj$:EasyAlign = {'idt': s} Pljjjj$:EasyAlign={'indent':d} Phhxxvip:EasyAlign={'idt':'s'} 525Gvipjy507GPPvip:EasyAlign*={'idt':s} Pvip:EasyAlign!**={'idt':s} Pvip:EasyAlign = {'idt': D} 525G^hhr1jr1jr1jr1jr1llkkkk$:EasyAlign = { 'idt': s } 513GvipjyPvip:EasyAlign*={'idt':n} Pvip:EasyAlign = { 'idt': N } Pvip:EasyAlign!*= {'idt': 'n'} 630Gvipjygv =Pvip =656Gvipjygv =Pvip *=Pvip **=Pvip **=Pvip:EasyAlign**= {'iu':0} Pvip =vip 2=vip -0 =818Gvipjygv =Pvip 2=Pvip *=Pvip **=Pvip **=Pvip -0=Pvip -0=855Gvip ** 860Gvip 2=}863Gvip 2=866Gvip 2=869Gvip 2=872Gvip *=875Gvip 2 878Gvip 2 881Gvip:EasyAlign**={'m': 'c','idt':s} ggjjj70Gvipjy883Gpvip *|vipjy893Gpvip:EasyAlign*|{'m': 'lcr'} 903Gpvip:EasyAlign**|{'m':'llc'} 913Gpvip:s/^|// vip:EasyAlign*|{'idt':n} vip:EasyAlign**|{'m':'cl'} 107GvipjyPvip  *=Pvip  *=975GVj 2=978Gvipjygv =Pvip =Pvip =Pvip =Pvip 2=993Gvip =996Gvip =999Gvip =1002Gvip =vipjyPvip =Pvip =1023Gvip =1026Gvip =1030Gvip =1033Gvip =1036Gvip 3=vipjyPvip 2=1044Gvip *,1052Gvipjygv:EasyAlign{'m':'lrc*'} 3 Pvip:EasyAlign{'mode_seq':'lrc**'} 2 Pvip:EasyAlign{'ms':'lccr**'} 1066Goa = 1 bb = 2 ccccc ddd = 3vipyvip =OPvip  = diff --git a/test/commandline.vader b/test/commandline.vader new file mode 100644 index 0000000..ac1db2f --- /dev/null +++ b/test/commandline.vader @@ -0,0 +1,157 @@ +Execute (Clean up test environment): + let g:easy_align_delimiters = {} + silent! unlet g:easy_align_ignore_groups + silent! unlet g:easy_align_ignore_unmatched + silent! unlet g:easy_align_indentation + silent! unlet g:easy_align_delimiter_align + +Given (fruits): + apple;:;;banana::cake + data;;exchange:;::format + +Execute (regular expression): + %EasyAlign/[:;]\+/ + +Expect: + apple ;:;; banana::cake + data ;; exchange:;::format + +Execute (options dictionary): + %EasyAlign/[:;]\+/{ 'left_margin': '<', 'right_margin': 3 } + +Expect: + apple<;:;; banana::cake + data < ;; exchange:;::format + +Execute (fuzzy matching): + %EasyAlign/[:;]\+/{ 'l':'<', 'r': '>'} + +Expect: + apple<;:;;>banana::cake + data < ;;>exchange:;::format + +Execute (shorthand notation of margin): + %EasyAlign/[:;]\+/l0r0 + +Expect: + apple;:;;banana::cake + data ;;exchange:;::format + +Execute (delimiter align): + %EasyAlign*/[:;]\+/l0r0dc + +Expect: + apple;:;;banana :: cake + data ;; exchange:;::format + +Execute (shorthand notation of mode_sequence and margin): + %EasyAlign/[:;]\+/mrc*l2r2 + +Expect: + apple ;:;; banana :: cake + data ;; exchange :;:: format + +Execute (deep indentation): + %EasyAlign/[:;]\+/mrc*l2r2 + %EasyAlign*/[:;]\+/idmrl* + +Expect: + apple ;:;; banana :: cake + data ;; exchange :;:: format + +Execute (stick_to_left): + %EasyAlign*/[:;]\+/stl1l0dlrm3 + +Expect: + apple;:;; banana:: cake + data;; exchange:;:: format + +Execute (different regular expression): + %EasyAlign*/../{'lm':'<','rm':'>'} + +Expect: + ap><:;><;b><:c>e + da><;;><:;><::>' } + +Expect: + ap><:;><;b><:c>e< + da><;;><:;><::> :EasyAlign + vnoremap :EasyAlign! ########################################################### @@ -330,16 +332,27 @@ Expect javascript: "user: pass": "r00t: pa55" }; +Execute (set g:easy_align_ignore_groups and g:easy_align_ignore_unmatched): + let g:easy_align_ignore_unmatched = 0 + let g:easy_align_ignore_groups = [] + +Do (do not ignore comments and strings, do not ignore unmatched using global vars): + vip\*: + Expect javascript: var jdbc = { // JDBC driver for MySQL database: - driver: "com.mysql.jdbc.Driver", - /* JDBC URL for the connection (jdbc:mysql://HOSTNAME/DATABASE) */ - url: 'jdbc:mysql://localhost/test', - database: "test", - "user:pass":"r00t:pa55" + driver: "com.mysql.jdbc.Driver", + /* JDBC URL for the connection (jdbc: mysql: //HOSTNAME/DATABASE) */ + url: 'jdbc: mysql: //localhost/test', + database: "test", + "user: pass": "r00t: pa55" }; +Execute (unset g:easy_align_ignore_groups and g:easy_align_ignore_unmatched): + unlet g:easy_align_ignore_unmatched + unlet g:easy_align_ignore_groups + ########################################################### Given (table): @@ -884,6 +897,22 @@ Expect: .third .call .method_4 .execute +Execute (set g:easy_align_indentation): + let g:easy_align_indentation = 'd' + +Do (around all . with deep indentation): + vip\*. + +Expect: + my_object + .method1 .chain + .second_method.call + .third .call + .method_4 .execute + +Execute (unset g:easy_align_indentation): + unlet g:easy_align_indentation + Do (right-align around all .): vip\\*. @@ -1086,3 +1115,123 @@ Expect: aaaaa = 12345 bbbbbbbbbb = 123456778901234567890 +########################################################### + +Given (long delimiter): + ...-.----- + ..--..---- + .---...--- + ----....-- + .---.....- + ..--...... + ...-.....- + +Do: + vip\*\-\+\ + +Expect: + ... - . ----- + .. -- .. ---- + . --- ... --- + ---- .... -- + . --- ..... - + .. -- ...... + ... - ..... - + +Do: + vip\*\\-\+\ + +Expect: + ... - . ----- + .. -- .. ---- + . --- ... --- + ---- .... -- + . --- ..... - + .. -- ...... + ... - ..... - + +Do: + vip\*\\\-\+\ + +Expect: + ... - . ----- + .. -- .. ---- + . --- ... --- + ---- .... -- + . --- ..... - + .. -- ...... + ... - ..... - + +Execute (set g:easy_align_delimiter_align): + let g:easy_align_delimiter_align = 'c' + +Do: + vip\*\-\+\ + +Expect: + ... - . ----- + .. -- .. ---- + . --- ... --- + ---- .... -- + . --- ..... - + .. -- ...... + ... - ..... - + +Execute (unset g:easy_align_delimiter_align): + unlet g:easy_align_delimiter_align + +########################################################### + +Execute (set g:easy_align_interactive_modes): + let g:easy_align_interactive_modes = ['r', 'c'] + let g:easy_align_bang_interactive_modes = ['c', 'l'] + +Given (Test g:easy_align_interactive_modes): + a = 1 + bb = 2 + ccc = 3 + +Do: + vip\= + +Expect: + a = 1 + bb = 2 + ccc = 3 + +Do: + vip\\= + +Expect: + a = 1 + bb = 2 + ccc = 3 + +Do: + vip\\= + +Expect: + a = 1 + bb = 2 + ccc = 3 + +Do: + vip\\\= + +Expect: + a = 1 + bb = 2 + ccc = 3 + +Do: + vip\\\\= + +Expect: + a = 1 + bb = 2 + ccc = 3 + +Execute (unset g:easy_align_interactive_modes): + unlet g:easy_align_interactive_modes + unlet g:easy_align_bang_interactive_modes + diff --git a/test/regexp.expected b/test/regexp.expected deleted file mode 100644 index 0ceea49..0000000 --- a/test/regexp.expected +++ /dev/null @@ -1,128 +0,0 @@ -" :source run.vim -" @a - -apple;:banana :: cake -data;;exchange :; format - -apple ;: banana :: cake - data ;; exchange :; format - -apple ;: banana :: cake -data ;; exchange :; format - -apple ;:____banana::cake -data ;;____exchange:;format - -apple ; : banana : : cake -data ; ; exchange : ; format - -ap pl e; :b an an a: :c ak e -da ta ;; ex ch an ge :; fo rm at - -ap ple;:banana::cake -da ta;;exchange:;format - -apple???;:~~~banana???::~~~ cake -data???;;~~~ exchange???:;~~~format - -apple;: banana::cake -data;; exchange:;format - -apple<<<;:>>>banana::cake -data <<<;;>>>exchange:;format - -apple ;: banana::cake -data ;; exchange:;format - -apple;:banana :: cake -data;;exchange :; format - -apple ;: banana :: cake -data ;; exchange :; format - -apple ;: banana :: cake -data ;; exchange :; format - -apple ;: banana :: cake -data ;; exchange :; format - -apple ;: banana :: cake -data ;; exchange :; format - -apple ;: banana::cake -data ;; exchange:;format - -apple ; :banana::cake -data ; ; exchange: ; format - -apple ; :banana::cake -data ; ;exchange:;format - -apple ; :banana::cake -data ; ;exchange:;format - -apple;:banana::cake -data;;exchange:;format - -apple;: banana: : cake -data;;exchange: ;format - -apple;:banana: :cake -data;;exchange:;format - -apple;:banana: :cake -data;;exchange:;format - -apple;: banana: : cake -data;;exchange: ;format - -apple;:banana:: cake -data;;exchange: ;format - -apple;: banana: : cake -data;;exchange: ;format - -apple;: banana::cake -data;;exchange: ;format - -```ruby -apple = 1 # comment not aligned -apricot = 'DAD' + 'F#AD' -banana = 'Gros Michel' # comment 2 -``` - -a()p()p()l()e();():()b()a()n()a()n()a():():()c()a()k()e( -d()a()t()a();();()e()x()c()h()a()n()g()e():();()f()o()r()m()a()t( - -apple ;: banana :: cake - data ;;exchange :;format - -apple ;: banana :: cake - data ;; exchange :; format - -apple;:banana ::cake -data ;;exchange:;format - -apple ;: banana :: cake -data ;; exchange :; format - -a+= 1 -bb==# 2 -ccc= 3 -dddd=> 4 - -apple;: banana:: cake - data;; exchange:; format - -```ruby -apple = 1 # comment not aligned -apricot = 'DAD' + 'F#AD' -banana = 'Gros Michel' # comment 2 -``` - -```ruby -apple = 1 # comment not aligned -apricot = 'DAD' + 'F#AD' -banana = 'Gros Michel' # comment 2 -``` - diff --git a/test/regexp.md b/test/regexp.md deleted file mode 100644 index 3a31b5a..0000000 --- a/test/regexp.md +++ /dev/null @@ -1,12 +0,0 @@ -" :source run.vim -" @a - -apple;:banana::cake -data;;exchange:;format - -```ruby -apple = 1 # comment not aligned -apricot = 'DAD' + 'F#AD' -banana = 'Gros Michel' # comment 2 -``` - diff --git a/test/regexp.script b/test/regexp.script deleted file mode 100644 index 159c0bd..0000000 --- a/test/regexp.script +++ /dev/null @@ -1 +0,0 @@ -4Gvipjyvip:EasyAlign: Pvip:EasyAlign*: Pvip:EasyAlign-: Pvip:EasyAlign * : Pvip:EasyAlign -2 : Pvip:EasyAlign -2: Pvip:EasyAlign *: Pvip:EasyAlign; Pvip:EasyAlign /;/ Pvip:EasyAlign/;/ Pvip:EasyAlign*/;/ Pvip:EasyAlign/[:;]\+/ Pvip:EasyAlign*/[:;]\+/ Pvip:EasyAlign* /[:;]\+/ Pvip:EasyAlign */[:;]\+/ Pvip:EasyAlign * /[:;]\+/ Pvip:EasyAlign-/[:;]\+/ Pvip:EasyAlign-2/[:;]\+/ Pvip:EasyAlign/[:;]\+/{ 'l': '<<<', 'r': '>>>'} Pvip:EasyAlign/[:;]\+/{'l':'', 's': 1} Pvip:EasyAlign * /[:;]\+/ {'stick_to': 1, 'le': '???', 'marr': '~~~'} Pvip:EasyAlign /../ Pvip:EasyAlign*/../ Pvip:EasyAlign **/[:;\+]/ Pvip:EasyAlign/[:;]\+/{'rm':'____'} Pvip:EasyAlign**/[:;]\+/ Pvip:EasyAlign!**/[:;]\+/ Pfbjfm:EasyAlign/[:;]\+/ 90Gvip:EasyAlign/#/{'is':['String'],'iu':0} 93Gpvip:EasyAlign*/\s*/{'l':'(', 'r': ')'} 96Gpvip:EasyAlign*/[:;]\+/r3l3s1 Pvip:EasyAlign*/[:;]\+/r0l0s0 Pvip:EasyAlign*/[:;]\+/mrcr Pvip:EasyAlign*/[:;]\+/mrcrr0l2 108Goa+=1 bb==#2 ccc=3 dddd=>4vip:EasyAlign=dll0s1r5id 112Gopvip:EasyAlign/[:;]\+/msrrc**lm0rm3stl1dacidtd 88Gvipjy116Gpvip:EasyAlign3\ ig['String'] Pvip:EasyAlign3\ ig['string'] diff --git a/test/run.vim b/test/run.vim deleted file mode 100644 index 4222159..0000000 --- a/test/run.vim +++ /dev/null @@ -1,51 +0,0 @@ -e! - -function! GFM() - let syntaxes = { - \ 'ruby': 'syntax/ruby.vim', - \ 'yaml': 'syntax/yaml.vim', - \ 'vim': 'syntax/vim.vim', - \ 'sh': 'syntax/sh.vim', - \ 'python': 'syntax/python.vim', - \ 'java': 'syntax/java.vim', - \ 'c': 'syntax/c.vim' - \ } - - for [lang, syn] in items(syntaxes) - unlet b:current_syntax - silent! exec printf("syntax include @%s %s", lang, syn) - exec printf("syntax region %sSnip matchgroup=Snip start='```%s' end='```' contains=@%s", - \ lang, lang, lang) - endfor - let b:current_syntax='mkd' - - syntax sync fromstart -endfunction - -silent! unlet g:easy_align_delimiters -silent! unlet g:easy_align_ignore_unmatched -silent! unlet g:easy_align_ignores - -vnoremap :EasyAlign - -noremap -noremap -noremap -noremap -vnoremap -vnoremap -vnoremap -vnoremap - -set nolazyredraw -set buftype=nofile -set colorcolumn= - -silent! ScrollPositionHide - -call GFM() - -normal gg -let @b=system('cat '. expand('%:p:r') . '.script') -let @a='@b:vert diffsplit ' . expand('%:p:r') . '.expected ' -" Syntax highlighting doesn't work if we do @a here