Commit e3ba4782 authored by David Owens II's avatar David Owens II

Foundational work for the CLJ parser.

Just getting setup to be able to write some real code with some really
basic tests in place.
parent 8aa4322b
// Place your settings in this file to overwrite default and user settings.
{
"editor.tabSize": 4,
"editor.insertSpaces": true
}
\ No newline at end of file
......@@ -10,6 +10,15 @@ tasks:
tool: "atllbuild"
source: ["src/**.swift"]
name: "atbuild"
tests:
tool: "atllbuild"
source: ["src/clj/**.swift", "tests/**.swift"]
name: "tests"
runtests:
tool: "shell"
script: "./.atllbuild/tests"
bootstrap:
tool: "atllbuild"
......
// © 2016 Anarchy Tools Contributors.
// This file is part of atbuild. It is subject to the license terms in the LICENSE
// file found in the top level of this distribution
// No part of atbuild, including this file, may be copied, modified,
// propagated, or distributed except according to the terms contained
// in the LICENSE file.
import Foundation
class SizedQueue<ElementType> {
var items: [ElementType] = []
let maximumNumberOfItems: Int
private var lastIndex: Int = 0
init(maximumNumberOfItems: Int = 10) {
self.maximumNumberOfItems = maximumNumberOfItems
}
}
\ No newline at end of file
// © 2016 Anarchy Tools Contributors.
// This file is part of atbuild. It is subject to the license terms in the LICENSE
// file found in the top level of this distribution
// No part of atbuild, including this file, may be copied, modified,
// propagated, or distributed except according to the terms contained
// in the LICENSE file.
enum test {
static func assert(condition: Bool, functionName: String = __FUNCTION__) {
print(" \(functionName): \(condition ? "PASSED" : "**FAILED**")")
}
}
class SizedQueueTests {
required init() {}
func runTests() {
print("Tests for \(__FILE__)")
testBasicInit()
}
func testBasicInit() {
let queue = SizedQueue<String>()
test.assert(10 == queue.maximumNumberOfItems)
}
}
\ No newline at end of file
// © 2016 Anarchy Tools Contributors.
// This file is part of atbuild. It is subject to the license terms in the LICENSE
// file found in the top level of this distribution
// No part of atbuild, including this file, may be copied, modified,
// propagated, or distributed except according to the terms contained
// in the LICENSE file.
protocol Test {
init()
func runTests()
}
let tests = [
SizedQueueTests()
]
for test in tests {
test.runTests()
}
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