Simple number literal parsing (#77)

This commit is contained in:
David Jennes
2016-12-07 20:33:06 +01:00
committed by Kyle Fuller
parent 15facd97fb
commit 2d507e7c11
2 changed files with 17 additions and 0 deletions

View File

@@ -45,6 +45,18 @@ func testVariable() {
try expect(result) == "name"
}
$0.it("can resolve an integer literal") {
let variable = Variable("5")
let result = try variable.resolve(context) as? Float80
try expect(result) == 5
}
$0.it("can resolve an float literal") {
let variable = Variable("3.14")
let result = try variable.resolve(context) as? Float80
try expect(result) == 3.14
}
$0.it("can resolve a string variable") {
let variable = Variable("name")
let result = try variable.resolve(context) as? String