Commit 20f21e7d authored by David Owens II's avatar David Owens II

Added a basic file to start as the sample test data.

parent 046e5d17
Pipeline #661 passed with stage
......@@ -68,14 +68,4 @@ class Scanner {
func peek() -> ScannerInfo? {
return current
}
func debugPrint() {
print("--- SCANNER INFO ---")
while let info = self.next() {
print("\(info)")
}
print("")
self._defaults()
}
}
\ No newline at end of file
......@@ -5,17 +5,37 @@
// propagated, or distributed except according to the terms contained
// in the LICENSE file.
import Foundation
class ScannerTests: Test {
required init() {}
let tests = [
ScannerTests.testBasicInit
ScannerTests.testBasicClj
]
let filename = __FILE__
static func testBasicInit() throws {
let scanner = Scanner(content: "")
try test.assert(scanner.content == "")
try test.assert(scanner.current == nil)
static func testBasicClj() throws {
let filepath = "./parsers/clj/tests/collateral/basic.clj"
let content: String = try NSString(contentsOfFile: filepath, encoding: NSUTF8StringEncoding) as String
let scanner = Scanner(content: content)
try test.assert(scanner.next()?.character == ";")
try test.assert(scanner.next()?.character == ";")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == "T")
try test.assert(scanner.next()?.character == "h")
try test.assert(scanner.next()?.character == "i")
try test.assert(scanner.next()?.character == "s")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == "i")
try test.assert(scanner.next()?.character == "s")
scanner.stall()
try test.assert(scanner.next()?.character == "s")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.peek()?.character == " ")
try test.assert(scanner.next()?.character == "t")
}
}
\ No newline at end of file
;; This is the most basic of sample files.
(project
:name "basic"
:version "0.1.0-dev"
:tasks {:build {:tool "lldb-build"
:name "json-swift"
:output-type "lib"
:source [ "src/**.swift" ]}}
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment