Failed Conditions
Pull Request — master (#1093)
by Lasse
01:45
created

bears.tests.Matlab.MatlabIndentationBearTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %
Metric Value
dl 0
loc 22
rs 10
wmc 3
1
import sys
2
import unittest
3
4
sys.path.insert(0, ".")
5
from bears.tests.LocalBearTestHelper import generate_local_bear_test
6
from bears.Matlab.MatlabIndentationBear import MatlabIndentationBear
7
8
9
MatlabIndentationBearTest = generate_local_bear_test(
10
    MatlabIndentationBear,
11
    valid_files=(["if a ~= b\n", "  a\n", "endif\n"],
12
                 ["if a ~= b\n",
13
                  "  a\n",
14
                  "  \n",
15
                  "else\n",
16
                  "  a\n",
17
                  "endif\n"]),
18
    invalid_files=(["  A"],
19
                   ["if a ~= b\n", "a\n", "endif\n"],
20
                   ["if a ~= b\n", " a\n", "endif\n"],
21
                   ["if a ~= b\n",
22
                    "  a\n",
23
                    "  else\n",
24
                    "  a\n",
25
                    "endif\n"]))
26
27
28
if __name__ == '__main__':
29
    unittest.main(verbosity=2)
30