Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit c4c6b50

Browse files
author
Patrick Thomson
authored
Merge pull request #169 from github/test-proto-symbols-cli-output
Add golden tests for `parse --proto-symbols` output.
2 parents b62277f + a5a349b commit c4c6b50

File tree

7 files changed

+14
-10
lines changed

7 files changed

+14
-10
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
test/fixtures linguist-vendored
33
test/repos linguist-vendored
44
vendor linguist-vendored
5+
*.protobuf.bin binary

test/Data/Functor/Listable.hs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,6 @@ liftCons4 :: [Tier a] -> [Tier b] -> [Tier c] -> [Tier d] -> (a -> b -> c -> d -
104104
liftCons4 tiers1 tiers2 tiers3 tiers4 f = mapT (uncurry4 f) (tiers1 >< tiers2 >< tiers3 >< tiers4) `addWeight` 1
105105
where uncurry4 f (a, (b, (c, d))) = f a b c d
106106

107-
-- | Lifts a quinary constructor to a list of tiers, given lists of tiers for its arguments.
108-
--
109-
-- Commonly used in the definition of 'Listable1' and 'Listable2' instances.
110-
liftCons5 :: [Tier a] -> [Tier b] -> [Tier c] -> [Tier d] -> [Tier e] -> (a -> b -> c -> d -> e -> f) -> [Tier f]
111-
liftCons5 tiers1 tiers2 tiers3 tiers4 tiers5 f = mapT (uncurry5 f) (tiers1 >< tiers2 >< tiers3 >< tiers4 >< tiers5) `addWeight` 1
112-
where uncurry5 f (a, (b, (c, (d, e)))) = f a b c d e
113-
114107
-- | Lifts a senary constructor to a list of tiers, given lists of tiers for its arguments.
115108
--
116109
-- Commonly used in the definition of 'Listable1' and 'Listable2' instances.

test/Semantic/CLI/Spec.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ parseFixtures =
5353
, ("json", parseTermBuilder TermJSONTree, path', prefix </> "parse-trees.json")
5454
, ("json", parseTermBuilder TermJSONTree, [], prefix </> "parse-tree-empty.json")
5555
, ("symbols", parseSymbolsBuilder Serializing.Format.JSON, path'', prefix </> "parse-tree.symbols.json")
56+
, ("protobuf symbols", parseSymbolsBuilder Serializing.Format.Proto, path'', prefix </> "parse-tree.symbols.protobuf.bin")
5657
]
5758
where path = [File "test/fixtures/ruby/corpus/and-or.A.rb" Ruby]
5859
path' = [File "test/fixtures/ruby/corpus/and-or.A.rb" Ruby, File "test/fixtures/ruby/corpus/and-or.B.rb" Ruby]
@@ -64,6 +65,7 @@ diffFixtures =
6465
[ ("json diff", parseDiffBuilder DiffJSONTree, pathMode, prefix </> "diff-tree.json")
6566
, ("s-expression diff", parseDiffBuilder DiffSExpression, pathMode, "test/fixtures/ruby/corpus/method-declaration.diffA-B.txt")
6667
, ("toc summaries diff", diffSummaryBuilder Serializing.Format.JSON, pathMode, prefix </> "diff-tree.toc.json")
68+
, ("protobuf diff", diffSummaryBuilder Serializing.Format.Proto, pathMode, prefix </> "diff-tree.toc.protobuf.bin")
6769
]
6870
where pathMode = [Both (File "test/fixtures/ruby/corpus/method-declaration.A.rb" Ruby) (File "test/fixtures/ruby/corpus/method-declaration.B.rb" Ruby)]
6971
prefix = "test/fixtures/cli"

test/Semantic/IO/Spec.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import Prelude hiding (readFile)
55
import Control.Monad.IO.Class
66
import Data.List
77
import System.Directory
8-
import System.Exit (ExitCode (..))
98
import System.IO.Temp
109
import Data.String
1110

test/Semantic/Stat/Spec.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import System.Environment
1111

1212
import Test.Tasty
1313
import Test.Tasty.HUnit
14-
import Test.Tasty.Runners
1514

1615
withSocketPair :: ((Socket, Socket) -> IO c) -> IO c
1716
withSocketPair = bracket create release
@@ -32,7 +31,7 @@ testTree = testCaseSteps "Semantic.Stat.Spec" $ \step -> do
3231
step "Handles stats addr with just hostname"
3332
case_handles_stats_addr_with_just_hostname
3433
step "takes dogstats host from environment"
35-
case_takes_stats_addr_from_environment
34+
case_takes_dogstats_host_from_environment
3635
step "rendering"
3736
case_render_counters *> case_render_tags
3837
step "stats deliver datagram"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
�
3+
ftest/fixtures/ruby/corpus/method-declaration.A.rb -> test/fixtures/ruby/corpus/method-declaration.B.rbRuby
4+
Methodbar
5+
 
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
_
3+
1test/fixtures/ruby/corpus/method-declaration.A.rbRuby$
4+
fooMethoddef foo"
5+


0 commit comments

Comments
 (0)