Add some tests
This commit is contained in:
1 file changed
+21
@@ -408,6 +408,23 @@ $delim
|
||||
it::getBase shouldBe 10
|
||||
}
|
||||
}
|
||||
|
||||
"0." should parseAs {
|
||||
number(DOUBLE) {
|
||||
it::getBase shouldBe 10
|
||||
}
|
||||
}
|
||||
val doubleOrFloatInBase10: NodeSpec<*> = {
|
||||
number {
|
||||
it::getBase shouldBe 10
|
||||
}
|
||||
}
|
||||
"05e10" should parseAs(doubleOrFloatInBase10)
|
||||
"05e10f" should parseAs(doubleOrFloatInBase10)
|
||||
"00f" should parseAs(doubleOrFloatInBase10)
|
||||
"00d" should parseAs(doubleOrFloatInBase10)
|
||||
"00D" should parseAs(doubleOrFloatInBase10)
|
||||
"050.0" should parseAs(doubleOrFloatInBase10)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -424,6 +441,7 @@ $delim
|
||||
it::getValueAsDouble shouldBe 30.0
|
||||
it::getValueAsFloat shouldBe 30f
|
||||
it::getValueAsInt shouldBe 30
|
||||
it::getBase shouldBe 16
|
||||
}
|
||||
}
|
||||
|
||||
@@ -436,6 +454,7 @@ $delim
|
||||
it::getValueAsDouble shouldBe 7.5
|
||||
it::getValueAsFloat shouldBe 7.5f
|
||||
it::getValueAsInt shouldBe 7
|
||||
it::getBase shouldBe 16
|
||||
}
|
||||
}
|
||||
|
||||
@@ -458,6 +477,7 @@ $delim
|
||||
it::getValueAsFloat shouldBe 15f
|
||||
it::getValueAsInt shouldBe 15
|
||||
it::getValueAsLong shouldBe 15L
|
||||
it::getBase shouldBe 16
|
||||
}
|
||||
}
|
||||
|
||||
@@ -508,6 +528,7 @@ $delim
|
||||
it::getValueAsFloat shouldBe 3f
|
||||
it::getValueAsInt shouldBe 3
|
||||
it::getValueAsLong shouldBe 3L
|
||||
it::getBase shouldBe 2
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user