Completed
Pull Request — master (#1431)
by Abdeali
01:31
created

bears.tests.c_languages.IndentBearTest.test_tabs()   A

Complexity

Conditions 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 1
dl 0
loc 6
rs 9.4285
1
from bears.c_languages.IndentBear import IndentBear
2
from bears.tests.LocalBearTestHelper import verify_local_bear
3
4
5
test_file1 = """
6
int
7
main ()
8
{
9
    return 0;
10
}""".split("\n")
11
12
test_file2 = """
13
int
14
main ()
15
{
16
  return 0;
17
}""".split("\n")
18
19
20
test_file3 = """
21
int
22
main ()
23
{
24
\treturn 0;
25
}""".split("\n")
26
27
28
test_file4 = """
29
int main() {
30
  return 0;
31
}""".split("\n")
32
33
34
IndentBear1Test = verify_local_bear(IndentBear,
35
                                    valid_files=(test_file1,),
36
                                    invalid_files=(test_file3,),
37
                                    settings={"use_spaces": "true",
38
                                              "max_line_length": "80"})
39
40
41
IndentBear2Test = verify_local_bear(IndentBear,
42
                                    valid_files=(test_file3,),
43
                                    invalid_files=(),
44
                                    settings={"use_spaces": "nope",
45
                                              "max_line_length": "80"})
46
47
48
IndentBear3Test = verify_local_bear(IndentBear,
49
                                    valid_files=(test_file2,),
50
                                    invalid_files=(),
51
                                    settings={"use_spaces": "true",
52
                                              "max_line_length": "80",
53
                                              "tab_width": "2"})
54
55
56
IndentBear4Test = verify_local_bear(IndentBear,
57
                                    valid_files=(),
58
                                    invalid_files=(test_file4,),
59
                                    settings={"use_spaces": "true",
60
                                              "max_line_length": "80"})
61