@@ -32,7 +32,8 @@ import TreeSitterP4
|
|||||||
let sm = SourceManager(["./TestData/Sources/"])
|
let sm = SourceManager(["./TestData/Sources/"])
|
||||||
let prep = SourceCodePreprocessor(sm)
|
let prep = SourceCodePreprocessor(sm)
|
||||||
let file = FilePath.init(stringLiteral: "./TestData/Sources/simple.p4")
|
let file = FilePath.init(stringLiteral: "./TestData/Sources/simple.p4")
|
||||||
let expected_file = FilePath.init(FileManager().currentDirectoryPath + "/" + file.string).lexicallyNormalized()
|
let expected_file = FilePath.init(FileManager().currentDirectoryPath + "/" + file.string)
|
||||||
|
.lexicallyNormalized()
|
||||||
|
|
||||||
let source = try! (#UseOkResult(prep.preprocess(file)))
|
let source = try! (#UseOkResult(prep.preprocess(file)))
|
||||||
let program = try! #UseOkResult(Program.Compile(source.getSource()))
|
let program = try! #UseOkResult(Program.Compile(source.getSource()))
|
||||||
@@ -44,7 +45,8 @@ import TreeSitterP4
|
|||||||
let sm = SourceManager(["./TestData/Sources/"])
|
let sm = SourceManager(["./TestData/Sources/"])
|
||||||
let prep = SourceCodePreprocessor(sm)
|
let prep = SourceCodePreprocessor(sm)
|
||||||
let file = FilePath.init(stringLiteral: "simple.p4")
|
let file = FilePath.init(stringLiteral: "simple.p4")
|
||||||
let expected_file = FilePath.init(FileManager().currentDirectoryPath + "/TestData/Sources/simple.p4")
|
let expected_file = FilePath.init(
|
||||||
|
FileManager().currentDirectoryPath + "/TestData/Sources/simple.p4")
|
||||||
|
|
||||||
let source = try! (#UseOkResult(prep.preprocess(file)))
|
let source = try! (#UseOkResult(prep.preprocess(file)))
|
||||||
let program = try! #UseOkResult(Program.Compile(source.getSource()))
|
let program = try! #UseOkResult(Program.Compile(source.getSource()))
|
||||||
@@ -56,7 +58,8 @@ import TreeSitterP4
|
|||||||
let sm = SourceManager(["./TestData/Sources/"])
|
let sm = SourceManager(["./TestData/Sources/"])
|
||||||
let prep = SourceCodePreprocessor(sm)
|
let prep = SourceCodePreprocessor(sm)
|
||||||
let file = FilePath.init(stringLiteral: "./TestData/Sources/simple-split.p4")
|
let file = FilePath.init(stringLiteral: "./TestData/Sources/simple-split.p4")
|
||||||
let expected_file = FilePath.init(FileManager().currentDirectoryPath + "/" + file.string).lexicallyNormalized()
|
let expected_file = FilePath.init(FileManager().currentDirectoryPath + "/" + file.string)
|
||||||
|
.lexicallyNormalized()
|
||||||
|
|
||||||
#expect(#RequireOkResult(prep.preprocess(file)))
|
#expect(#RequireOkResult(prep.preprocess(file)))
|
||||||
|
|
||||||
@@ -70,7 +73,8 @@ import TreeSitterP4
|
|||||||
let sm = SourceManager(["./TestData/Sources/"])
|
let sm = SourceManager(["./TestData/Sources/"])
|
||||||
let prep = SourceCodePreprocessor(sm)
|
let prep = SourceCodePreprocessor(sm)
|
||||||
let file = FilePath.init(stringLiteral: "./TestData/Sources/simple-split-oneline.p4")
|
let file = FilePath.init(stringLiteral: "./TestData/Sources/simple-split-oneline.p4")
|
||||||
let expected_file = FilePath.init(FileManager().currentDirectoryPath + "/" + file.string).lexicallyNormalized()
|
let expected_file = FilePath.init(FileManager().currentDirectoryPath + "/" + file.string)
|
||||||
|
.lexicallyNormalized()
|
||||||
|
|
||||||
#expect(#RequireOkResult(prep.preprocess(file)))
|
#expect(#RequireOkResult(prep.preprocess(file)))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user