@@ -7,82 +7,82 @@ import Semantic.Api.Symbols
7
7
import Source.Loc
8
8
import SpecHelpers
9
9
import qualified System.Path as Path
10
- import qualified System.Path.Bazel as Path
10
+ import qualified System.Path.Fixture as Fixture
11
11
import Tags.Tagging.Precise
12
12
13
- spec :: Path. HasBazel => Spec
13
+ spec :: Fixture. HasFixture => Spec
14
14
spec = do
15
15
describe " go" $ do
16
16
it " produces tags for functions with docs (TODO)" $
17
- parseTestFile [P. FUNCTION ] (Path. bazelFile " test/fixtures/go/tags/simple_functions.go" ) `shouldReturn`
17
+ parseTestFile [P. FUNCTION ] (Fixture. absFile " test/fixtures/go/tags/simple_functions.go" ) `shouldReturn`
18
18
[ Tag " TestFromBits" P. FUNCTION P. DEFINITION (Loc (Range 56 68 ) (Span (Pos 6 6 ) (Pos 6 18 ))) " func TestFromBits(t *testing.T) {" Nothing
19
19
, Tag " Hi" P. FUNCTION P. DEFINITION (Loc (Range 99 101 ) (Span (Pos 10 6 ) (Pos 10 8 ))) " func Hi() {" Nothing ]
20
20
21
21
it " produces tags for methods" $
22
- parseTestFile [] (Path. bazelFile " test/fixtures/go/tags/method.go" ) `shouldReturn`
22
+ parseTestFile [] (Fixture. absFile " test/fixtures/go/tags/method.go" ) `shouldReturn`
23
23
[ Tag " CheckAuth" P. METHOD P. DEFINITION (Loc (Range 39 48 ) (Span (Pos 3 21 ) (Pos 3 30 ))) " func (c *apiClient) CheckAuth(req *http.Request, user, repo string) (*authenticatedActor, error) {}" Nothing ]
24
24
25
25
it " produces tags for calls" $
26
- parseTestFile [P. CALL ] (Path. bazelFile " test/fixtures/go/tags/simple_functions.go" ) `shouldReturn`
26
+ parseTestFile [P. CALL ] (Fixture. absFile " test/fixtures/go/tags/simple_functions.go" ) `shouldReturn`
27
27
[ Tag " Hi" P. CALL P. REFERENCE (Loc (Range 86 88 ) (Span (Pos 7 2 ) (Pos 7 4 ))) " Hi()" Nothing ]
28
28
29
29
describe " javascript and typescript" $ do
30
30
it " produces tags for functions with docs (TODO)" $
31
- parseTestFile [] (Path. bazelFile " test/fixtures/javascript/tags/simple_function_with_docs.js" ) `shouldReturn`
31
+ parseTestFile [] (Fixture. absFile " test/fixtures/javascript/tags/simple_function_with_docs.js" ) `shouldReturn`
32
32
[ Tag " myFunction" P. FUNCTION P. DEFINITION (Loc (Range 31 41 ) (Span (Pos 2 10 ) (Pos 2 20 ))) " function myFunction() {" Nothing ]
33
33
34
34
it " produces tags for classes" $
35
- parseTestFile [] (Path. bazelFile " test/fixtures/typescript/tags/class.ts" ) `shouldReturn`
35
+ parseTestFile [] (Fixture. absFile " test/fixtures/typescript/tags/class.ts" ) `shouldReturn`
36
36
[ Tag " FooBar" P. CLASS P. DEFINITION (Loc (Range 6 12 ) (Span (Pos 1 7 ) (Pos 1 13 ))) " class FooBar {}" Nothing ]
37
37
38
38
it " produces tags for modules" $
39
- parseTestFile [] (Path. bazelFile " test/fixtures/typescript/tags/module.ts" ) `shouldReturn`
39
+ parseTestFile [] (Fixture. absFile " test/fixtures/typescript/tags/module.ts" ) `shouldReturn`
40
40
[ Tag " APromise" P. MODULE P. DEFINITION (Loc (Range 7 15 ) (Span (Pos 1 8 ) (Pos 1 16 ))) " module APromise { }" Nothing ]
41
41
42
42
describe " python" $ do
43
43
it " produces tags for functions" $
44
- parseTestFile [] (Path. bazelFile " test/fixtures/python/tags/simple_functions.py" ) `shouldReturn`
44
+ parseTestFile [] (Fixture. absFile " test/fixtures/python/tags/simple_functions.py" ) `shouldReturn`
45
45
[ Tag " Foo" P. FUNCTION P. DEFINITION (Loc (Range 4 7 ) (Span (Pos 1 5 ) (Pos 1 8 ))) " def Foo(x):" Nothing
46
46
, Tag " Bar" P. FUNCTION P. DEFINITION (Loc (Range 74 77 ) (Span (Pos 7 5 ) (Pos 7 8 ))) " def Bar():" Nothing
47
47
, Tag " local" P. FUNCTION P. DEFINITION (Loc (Range 89 94 ) (Span (Pos 8 9 ) (Pos 8 14 ))) " def local():" Nothing
48
48
]
49
49
50
50
it " produces tags for functions with docs" $
51
- parseTestFile [] (Path. bazelFile " test/fixtures/python/tags/simple_function_with_docs.py" ) `shouldReturn`
51
+ parseTestFile [] (Fixture. absFile " test/fixtures/python/tags/simple_function_with_docs.py" ) `shouldReturn`
52
52
[ Tag " Foo" P. FUNCTION P. DEFINITION (Loc (Range 4 7 ) (Span (Pos 1 5 ) (Pos 1 8 ))) " def Foo(x):" (Just " \"\"\" This is the foo function\"\"\" " ) ]
53
53
54
54
it " produces tags for classes" $
55
- parseTestFile [] (Path. bazelFile " test/fixtures/python/tags/class.py" ) `shouldReturn`
55
+ parseTestFile [] (Fixture. absFile " test/fixtures/python/tags/class.py" ) `shouldReturn`
56
56
[ Tag " Foo" P. CLASS P. DEFINITION (Loc (Range 6 9 ) (Span (Pos 1 7 ) (Pos 1 10 ))) " class Foo:" (Just " \"\"\" The Foo class\"\"\" " )
57
57
, Tag " f" P. FUNCTION P. DEFINITION (Loc (Range 43 44 ) (Span (Pos 3 9 ) (Pos 3 10 ))) " def f(self):" (Just " \"\"\" The f method\"\"\" " )
58
58
]
59
59
60
60
it " produces tags for multi-line functions" $
61
- parseTestFile [P. FUNCTION ] (Path. bazelFile " test/fixtures/python/tags/multiline.py" ) `shouldReturn`
61
+ parseTestFile [P. FUNCTION ] (Fixture. absFile " test/fixtures/python/tags/multiline.py" ) `shouldReturn`
62
62
[ Tag " Foo" P. FUNCTION P. DEFINITION (Loc (Range 4 7 ) (Span (Pos 1 5 ) (Pos 1 8 ))) " def Foo(x," Nothing ]
63
63
64
64
describe " ruby" $ do
65
65
it " produces tags for methods" $
66
- parseTestFile [P. METHOD ] (Path. bazelFile " test/fixtures/ruby/tags/simple_method.rb" ) `shouldReturn`
66
+ parseTestFile [P. METHOD ] (Fixture. absFile " test/fixtures/ruby/tags/simple_method.rb" ) `shouldReturn`
67
67
[ Tag " foo" P. METHOD P. DEFINITION (Loc (Range 4 7 ) (Span (Pos 1 5 ) (Pos 1 8 ))) " def foo" Nothing ]
68
68
69
69
it " produces tags for sends" $
70
- parseTestFile [P. CALL ] (Path. bazelFile " test/fixtures/ruby/tags/simple_method.rb" ) `shouldReturn`
70
+ parseTestFile [P. CALL ] (Fixture. absFile " test/fixtures/ruby/tags/simple_method.rb" ) `shouldReturn`
71
71
[ Tag " puts" P. CALL P. REFERENCE (Loc (Range 10 14 ) (Span (Pos 2 3 ) (Pos 2 7 ))) " puts \" hi\" " Nothing
72
72
, Tag " bar" P. CALL P. REFERENCE (Loc (Range 24 27 ) (Span (Pos 3 5 ) (Pos 3 8 ))) " a.bar" Nothing
73
73
, Tag " a" P. CALL P. REFERENCE (Loc (Range 22 23 ) (Span (Pos 3 3 ) (Pos 3 4 ))) " a" Nothing
74
74
]
75
75
76
76
it " produces tags for methods with docs (TODO)" $
77
- parseTestFile [] (Path. bazelFile " test/fixtures/ruby/tags/simple_method_with_docs.rb" ) `shouldReturn`
77
+ parseTestFile [] (Fixture. absFile " test/fixtures/ruby/tags/simple_method_with_docs.rb" ) `shouldReturn`
78
78
[ Tag " foo" P. METHOD P. DEFINITION (Loc (Range 18 21 ) (Span (Pos 2 5 ) (Pos 2 8 ))) " def foo" Nothing ]
79
79
80
80
it " correctly tags files containing multibyte UTF-8 characters (TODO)" $
81
- parseTestFile [] (Path. bazelFile " test/fixtures/ruby/tags/unicode_identifiers.rb" ) `shouldReturn`
81
+ parseTestFile [] (Fixture. absFile " test/fixtures/ruby/tags/unicode_identifiers.rb" ) `shouldReturn`
82
82
[ Tag " 日本語" P. METHOD P. DEFINITION (Loc (Range 20 29 ) (Span (Pos 2 5 ) (Pos 2 14 ))) " def 日本語" Nothing ]
83
83
84
84
it " produces tags for methods and classes with docs (TODO)" $
85
- parseTestFile [P. MODULE , P. CLASS , P. METHOD ] (Path. bazelFile " test/fixtures/ruby/tags/class_module.rb" ) `shouldReturn`
85
+ parseTestFile [P. MODULE , P. CLASS , P. METHOD ] (Fixture. absFile " test/fixtures/ruby/tags/class_module.rb" ) `shouldReturn`
86
86
[ Tag " Foo" P. MODULE P. DEFINITION (Loc (Range 21 24 ) (Span (Pos 2 8 ) (Pos 2 11 ))) " module Foo" Nothing
87
87
, Tag " Bar" P. CLASS P. DEFINITION (Loc (Range 50 53 ) (Span (Pos 5 9 ) (Pos 5 12 ))) " class Bar" Nothing
88
88
, Tag " baz" P. METHOD P. DEFINITION (Loc (Range 81 84 ) (Span (Pos 8 9 ) (Pos 8 12 ))) " def baz(a)" Nothing
0 commit comments