|
1 | | -# Test case |
2 | | - |
3 | | -# mapleader is set in the local vimrc |
4 | | -# |
5 | | -# Line +Text: 3 |
6 | | -# Line -Text: 8 |
7 | | - |
8 | 1 | Include: text_setup.vader |
9 | 2 | Include: env_setup.vader |
10 | 3 |
|
11 | 4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
12 | 5 |
|
13 | 6 | "" |
14 | | -" Standard usecase, buffer with some text |
15 | | -Execute (C +std_debug +Text): |
16 | | - :set filetype=c |
17 | | - 3 |
| 7 | +" tests include the following |
| 8 | +" - Add Debugging string when I am in a line that has text + make sure the counter advances |
| 9 | +" - Add Debugging string when I am on an empty line |
| 10 | +" - Add a variable debugging string when I am in a line that has text |
| 11 | +After (): |
| 12 | + execute l1_text - 1 |
18 | 13 | AssertEqual getline('.'), 'And each in your season', "Current line contents don't match" |
19 | | - Log join(getline(1,'$'), "\n") |
20 | 14 | :normal ,ds |
21 | | - Log join(getline(1,'$'), "\n") |
22 | 15 | :normal . |
23 | | - Log join(getline(1,'$'), "\n") |
24 | | - |
25 | | -Then (): |
26 | | - 4 |
27 | | - AssertEqual getline('.'), 'printf("[[Vader-workbench]:4] DEBUGGING STRING ==> %d\n", 0);' |
28 | | - 5 |
29 | | - AssertEqual getline('.'), 'printf("[[Vader-workbench]:5] DEBUGGING STRING ==> %d\n", 1);' |
30 | | - |
31 | | -================================================================================ |
32 | | - |
33 | | -"" |
34 | | -" What happens if there isn't any text in the current line? - cursor should stay |
35 | | -" at the same line |
36 | | -Execute (C +std_debug -Text): |
37 | | - :set filetype=c |
38 | | - 8 |
| 16 | + execute l1_notext |
39 | 17 | AssertEqual getline('.'), '', "Current line is not empty" |
40 | 18 | :normal ,ds |
41 | | - |
42 | | -Then (): |
43 | | - 8 |
44 | | - AssertEqual getline('.'), 'printf("[[Vader-workbench]:8] DEBUGGING STRING ==> %d\n", 0);' |
| 19 | + execute l1_text_var - 1 |
| 20 | + execute ":normal ,dSa**2 + b**2\<CR>" |
| 21 | + |
| 22 | + execute l1_text |
| 23 | + AssertEqual getline('.'), FormatStrForExpectedLine(GetFileForLang(&filetype, 1), l1_text, 0) |
| 24 | + execute l2_text |
| 25 | + AssertEqual getline('.'), FormatStrForExpectedLine(GetFileForLang(&filetype, 1), l2_text, 1) |
| 26 | + execute l1_notext |
| 27 | + AssertEqual getline('.'), FormatStrForExpectedLine(GetFileForLang(&filetype, 1), l1_notext, 2) |
| 28 | + execute l1_text_var |
| 29 | + AssertEqual getline('.'), FormatStrForExpectedLine(GetFileForLang(&filetype, 2), l1_text_var, -1) |
45 | 30 |
|
46 | 31 | ================================================================================ |
47 | 32 |
|
48 | | -Execute (C +var_debug -Text TODO): |
49 | | - :set filetype=c |
50 | | -Then (): |
51 | | -================================================================================ |
52 | | -Execute (C +var_debug +Text TODO): |
| 33 | +"" |
| 34 | +" Test cases - one for each supported language |
| 35 | +Execute (C): |
53 | 36 | :set filetype=c |
54 | | -Then (): |
55 | | -================================================================================ |
| 37 | +Execute (C++): |
| 38 | + :set filetype=cpp |
| 39 | +Execute (CMake): |
| 40 | + :set filetype=cmake |
| 41 | +Execute (Haskell): |
| 42 | + :set filetype=haskell |
| 43 | +Execute (Java): |
| 44 | + :set filetype=java |
| 45 | +Execute (Python): |
| 46 | + :set filetype=python |
| 47 | +" Execute (Ruby): |
| 48 | +" :set filetype=rb |
| 49 | +Execute (R): |
| 50 | + :set filetype=r |
| 51 | +Execute (Shell): |
| 52 | + :set filetype=sh |
| 53 | +Execute (Vim): |
| 54 | + :set filetype=vim |
56 | 55 |
|
57 | | -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 56 | +================================================================================ |
58 | 57 |
|
59 | | -# cmake |
60 | | -# cpp |
61 | | -# fortran |
62 | | -# haskell |
63 | | -# javascript |
64 | | -# java |
65 | | -# php |
66 | | -# python |
67 | | -# ruby |
68 | | -# r |
69 | | -# sh |
70 | | -# vim |
71 | 58 |
|
72 | | -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
0 commit comments