Refactor P4Compiler to P4Parser
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
|
||||
import Foundation
|
||||
import Macros
|
||||
import P4Compiler
|
||||
import SwiftTreeSitter
|
||||
import SystemPackage
|
||||
import Testing
|
||||
@@ -25,6 +24,7 @@ import TreeSitter
|
||||
import TreeSitterP4
|
||||
|
||||
@testable import Common
|
||||
@testable import P4Parser
|
||||
|
||||
@Test func test_preprocessor() async throws {
|
||||
let sm = SourceManager(["./TestData/Sources/"])
|
||||
@@ -32,7 +32,7 @@ import TreeSitterP4
|
||||
let file = FilePath.init(stringLiteral: "simple.p4")
|
||||
|
||||
let source = try! (#UseOkResult(prep.preprocess(file)))
|
||||
#expect(#RequireOkResult(SpecialCompilers.ProgramCompiler.Compile(source.getSource())))
|
||||
#expect(#RequireOkResult(compile(source.getSource())))
|
||||
#expect(source.getLocations().getPath() == file)
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ import TreeSitterP4
|
||||
let file = FilePath.init(stringLiteral: "simple.p4")
|
||||
|
||||
let source = try! (#UseOkResult(prep.preprocess(file)))
|
||||
#expect(#RequireOkResult(SpecialCompilers.ProgramCompiler.Compile(source.getSource())))
|
||||
#expect(#RequireOkResult(compile(source.getSource())))
|
||||
#expect(source.getLocations().getPath() == file)
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ import TreeSitterP4
|
||||
#expect(#RequireOkResult(prep.preprocess(file)))
|
||||
|
||||
let source = try! (#UseOkResult(prep.preprocess(file)))
|
||||
#expect(#RequireOkResult(SpecialCompilers.ProgramCompiler.Compile(source.getSource())))
|
||||
#expect(#RequireOkResult(compile(source.getSource())))
|
||||
#expect(source.getLocations().getPath() == file)
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ import TreeSitterP4
|
||||
#expect(#RequireOkResult(prep.preprocess(file)))
|
||||
|
||||
let source = try! (#UseOkResult(prep.preprocess(file)))
|
||||
#expect(#RequireOkResult(SpecialCompilers.ProgramCompiler.Compile(source.getSource())))
|
||||
#expect(#RequireOkResult(compile(source.getSource())))
|
||||
#expect(source.getLocations().getPath() == file)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user