@@ -38,7 +38,8 @@ spec :: TopSpec
3838spec = describe " Example3" $ do
3939 it " produces expected output" $ do
4040 let inputDoc = listToDoc (T. splitOn " \n " testCode)
41- (outputDoc, sifter :: DeclarationSifter ) <- project (DeclarationSifterParams " cling-parser" " __notebook_exec" ) inputDoc
41+ (outputDoc, sifter :: DeclarationSifter , eitherErr ) <- project (DeclarationSifterParams " cling-parser" " __notebook_exec" ) inputDoc
42+ eitherErr `shouldBe` Right ()
4243 T. intercalate " \n " (docToList outputDoc) `shouldBe` expectedFinalOutput
4344
4445 -- forward[origLine] = outputLine
@@ -52,7 +53,7 @@ spec = describe "Example3" $ do
5253 describe " position transformations" $ do
5354 it " transforms #include (sifted, stays at line 0)" $ do
5455 let inputDoc = listToDoc (T. splitOn " \n " testCode)
55- (_, sifter :: DeclarationSifter ) <- project (DeclarationSifterParams " cling-parser" " __notebook_exec" ) inputDoc
56+ (_, sifter :: DeclarationSifter , _ ) <- project (DeclarationSifterParams " cling-parser" " __notebook_exec" ) inputDoc
5657 let params = DeclarationSifterParams " cling-parser" " __notebook_exec"
5758
5859 -- #include is at line 0 in input, stays at line 0 in output
@@ -61,15 +62,15 @@ spec = describe "Example3" $ do
6162
6263 it " untransforms #include" $ do
6364 let inputDoc = listToDoc (T. splitOn " \n " testCode)
64- (_, sifter :: DeclarationSifter ) <- project (DeclarationSifterParams " cling-parser" " __notebook_exec" ) inputDoc
65+ (_, sifter :: DeclarationSifter , _ ) <- project (DeclarationSifterParams " cling-parser" " __notebook_exec" ) inputDoc
6566 let params = DeclarationSifterParams " cling-parser" " __notebook_exec"
6667
6768 Just pos <- return $ untransformPosition params sifter (Position 0 0 )
6869 pos `shouldBe` Position 0 0
6970
7071 it " transforms var (sifted but moved)" $ do
7172 let inputDoc = listToDoc (T. splitOn " \n " testCode)
72- (_, sifter :: DeclarationSifter ) <- project (DeclarationSifterParams " cling-parser" " __notebook_exec" ) inputDoc
73+ (_, sifter :: DeclarationSifter , _ ) <- project (DeclarationSifterParams " cling-parser" " __notebook_exec" ) inputDoc
7374 let params = DeclarationSifterParams " cling-parser" " __notebook_exec"
7475
7576 -- int x is at line 3 in input, should move to line 4 in output (include, using, class, func, VAR)
@@ -78,15 +79,15 @@ spec = describe "Example3" $ do
7879
7980 it " untransforms var" $ do
8081 let inputDoc = listToDoc (T. splitOn " \n " testCode)
81- (_, sifter :: DeclarationSifter ) <- project (DeclarationSifterParams " cling-parser" " __notebook_exec" ) inputDoc
82+ (_, sifter :: DeclarationSifter , _ ) <- project (DeclarationSifterParams " cling-parser" " __notebook_exec" ) inputDoc
8283 let params = DeclarationSifterParams " cling-parser" " __notebook_exec"
8384
8485 Just pos <- return $ untransformPosition params sifter (Position 4 0 )
8586 pos `shouldBe` Position 3 0
8687
8788 it " transforms cout (executable, wrapped with indent)" $ do
8889 let inputDoc = listToDoc (T. splitOn " \n " testCode)
89- (_, sifter :: DeclarationSifter ) <- project (DeclarationSifterParams " cling-parser" " __notebook_exec" ) inputDoc
90+ (_, sifter :: DeclarationSifter , _ ) <- project (DeclarationSifterParams " cling-parser" " __notebook_exec" ) inputDoc
9091 let params = DeclarationSifterParams " cling-parser" " __notebook_exec"
9192
9293 -- First cout is at line 2 col 0 in input
@@ -97,15 +98,15 @@ spec = describe "Example3" $ do
9798
9899 it " untransforms cout" $ do
99100 let inputDoc = listToDoc (T. splitOn " \n " testCode)
100- (_, sifter :: DeclarationSifter ) <- project (DeclarationSifterParams " cling-parser" " __notebook_exec" ) inputDoc
101+ (_, sifter :: DeclarationSifter , _ ) <- project (DeclarationSifterParams " cling-parser" " __notebook_exec" ) inputDoc
101102 let params = DeclarationSifterParams " cling-parser" " __notebook_exec"
102103
103104 Just pos <- return $ untransformPosition params sifter (Position 6 2 )
104105 pos `shouldBe` Position 2 0
105106
106107 it " transforms second cout" $ do
107108 let inputDoc = listToDoc (T. splitOn " \n " testCode)
108- (_, sifter :: DeclarationSifter ) <- project (DeclarationSifterParams " cling-parser" " __notebook_exec" ) inputDoc
109+ (_, sifter :: DeclarationSifter , _ ) <- project (DeclarationSifterParams " cling-parser" " __notebook_exec" ) inputDoc
109110 let params = DeclarationSifterParams " cling-parser" " __notebook_exec"
110111
111112 -- Second cout is at line 6 col 0 in input, should be at line 7 col 2 in output
@@ -114,7 +115,7 @@ spec = describe "Example3" $ do
114115
115116 it " untransforms second cout" $ do
116117 let inputDoc = listToDoc (T. splitOn " \n " testCode)
117- (_, sifter :: DeclarationSifter ) <- project (DeclarationSifterParams " cling-parser" " __notebook_exec" ) inputDoc
118+ (_, sifter :: DeclarationSifter , _ ) <- project (DeclarationSifterParams " cling-parser" " __notebook_exec" ) inputDoc
118119 let params = DeclarationSifterParams " cling-parser" " __notebook_exec"
119120
120121 Just pos <- return $ untransformPosition params sifter (Position 7 2 )
0 commit comments