2024-09-08 14:03:57 +00:00
|
|
|
package prog8tests.compiler
|
2022-02-10 23:21:40 +00:00
|
|
|
|
|
|
|
import io.kotest.assertions.throwables.shouldThrow
|
|
|
|
import io.kotest.core.spec.style.FunSpec
|
|
|
|
import io.kotest.matchers.shouldBe
|
|
|
|
import io.kotest.matchers.shouldNotBe
|
|
|
|
import io.kotest.matchers.string.shouldContain
|
|
|
|
import prog8.ast.base.ExpressionError
|
|
|
|
import prog8.ast.expressions.ArrayLiteral
|
|
|
|
import prog8.ast.expressions.InferredTypes
|
|
|
|
import prog8.ast.expressions.NumericLiteral
|
|
|
|
import prog8.ast.expressions.StringLiteral
|
2024-09-04 19:49:47 +00:00
|
|
|
import prog8.code.core.BaseDataType
|
2024-09-08 12:38:34 +00:00
|
|
|
import prog8.code.core.DataType
|
2022-03-10 21:38:16 +00:00
|
|
|
import prog8.code.core.Encoding
|
|
|
|
import prog8.code.core.Position
|
|
|
|
|
2022-02-10 23:21:40 +00:00
|
|
|
|
|
|
|
class TestNumericLiteral: FunSpec({
|
|
|
|
|
|
|
|
fun sameValueAndType(lv1: NumericLiteral, lv2: NumericLiteral): Boolean {
|
|
|
|
return lv1.type==lv2.type && lv1==lv2
|
|
|
|
}
|
|
|
|
|
|
|
|
val dummyPos = Position("test", 0, 0, 0)
|
|
|
|
|
|
|
|
test("testIdentity") {
|
2024-09-01 18:19:24 +00:00
|
|
|
val v = NumericLiteral(BaseDataType.UWORD, 12345.0, dummyPos)
|
2022-02-10 23:21:40 +00:00
|
|
|
(v==v) shouldBe true
|
|
|
|
(v != v) shouldBe false
|
|
|
|
(v <= v) shouldBe true
|
|
|
|
(v >= v) shouldBe true
|
|
|
|
(v < v ) shouldBe false
|
|
|
|
(v > v ) shouldBe false
|
|
|
|
|
2024-09-01 18:19:24 +00:00
|
|
|
sameValueAndType(NumericLiteral(BaseDataType.UWORD, 12345.0, dummyPos), NumericLiteral(BaseDataType.UWORD, 12345.0, dummyPos)) shouldBe true
|
2022-02-10 23:21:40 +00:00
|
|
|
}
|
|
|
|
|
2023-12-15 21:05:57 +00:00
|
|
|
test("test truncating") {
|
2022-02-10 23:21:40 +00:00
|
|
|
shouldThrow<ExpressionError> {
|
2024-09-01 18:19:24 +00:00
|
|
|
NumericLiteral(BaseDataType.BYTE, -2.345, dummyPos)
|
2023-12-15 21:05:57 +00:00
|
|
|
}.message shouldContain "refused truncating"
|
2022-02-10 23:21:40 +00:00
|
|
|
shouldThrow<ExpressionError> {
|
2024-09-01 18:19:24 +00:00
|
|
|
NumericLiteral(BaseDataType.BYTE, -2.6, dummyPos)
|
2023-12-15 21:05:57 +00:00
|
|
|
}.message shouldContain "refused truncating"
|
2022-02-10 23:21:40 +00:00
|
|
|
shouldThrow<ExpressionError> {
|
2024-09-01 18:19:24 +00:00
|
|
|
NumericLiteral(BaseDataType.UWORD, 2222.345, dummyPos)
|
2023-12-15 21:05:57 +00:00
|
|
|
}.message shouldContain "refused truncating"
|
2024-09-01 18:19:24 +00:00
|
|
|
NumericLiteral(BaseDataType.UBYTE, 2.0, dummyPos).number shouldBe 2.0
|
|
|
|
NumericLiteral(BaseDataType.BYTE, -2.0, dummyPos).number shouldBe -2.0
|
|
|
|
NumericLiteral(BaseDataType.UWORD, 2222.0, dummyPos).number shouldBe 2222.0
|
|
|
|
NumericLiteral(BaseDataType.FLOAT, 123.456, dummyPos)
|
2022-02-10 23:21:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
test("testEqualsAndNotEquals") {
|
2024-09-01 18:19:24 +00:00
|
|
|
(NumericLiteral(BaseDataType.UBYTE, 100.0, dummyPos) == NumericLiteral(BaseDataType.UBYTE, 100.0, dummyPos)) shouldBe true
|
|
|
|
(NumericLiteral(BaseDataType.UBYTE, 100.0, dummyPos) == NumericLiteral(BaseDataType.UWORD, 100.0, dummyPos)) shouldBe true
|
|
|
|
(NumericLiteral(BaseDataType.UBYTE, 100.0, dummyPos) == NumericLiteral(BaseDataType.FLOAT, 100.0, dummyPos)) shouldBe true
|
|
|
|
(NumericLiteral(BaseDataType.UWORD, 254.0, dummyPos) == NumericLiteral(BaseDataType.UBYTE, 254.0, dummyPos)) shouldBe true
|
|
|
|
(NumericLiteral(BaseDataType.UWORD, 12345.0, dummyPos) == NumericLiteral(BaseDataType.UWORD, 12345.0, dummyPos)) shouldBe true
|
|
|
|
(NumericLiteral(BaseDataType.UWORD, 12345.0, dummyPos) == NumericLiteral(BaseDataType.FLOAT, 12345.0, dummyPos)) shouldBe true
|
|
|
|
(NumericLiteral(BaseDataType.FLOAT, 100.0, dummyPos) == NumericLiteral(BaseDataType.UBYTE, 100.0, dummyPos)) shouldBe true
|
|
|
|
(NumericLiteral(BaseDataType.FLOAT, 22239.0, dummyPos) == NumericLiteral(BaseDataType.UWORD, 22239.0, dummyPos)) shouldBe true
|
|
|
|
(NumericLiteral(BaseDataType.FLOAT, 9.99, dummyPos) == NumericLiteral(BaseDataType.FLOAT, 9.99, dummyPos)) shouldBe true
|
|
|
|
|
|
|
|
sameValueAndType(NumericLiteral(BaseDataType.UBYTE, 100.0, dummyPos), NumericLiteral(BaseDataType.UBYTE, 100.0, dummyPos)) shouldBe true
|
|
|
|
sameValueAndType(NumericLiteral(BaseDataType.UBYTE, 100.0, dummyPos), NumericLiteral(BaseDataType.UWORD, 100.0, dummyPos)) shouldBe false
|
|
|
|
sameValueAndType(NumericLiteral(BaseDataType.UBYTE, 100.0, dummyPos), NumericLiteral(BaseDataType.FLOAT, 100.0, dummyPos)) shouldBe false
|
|
|
|
sameValueAndType(NumericLiteral(BaseDataType.UWORD, 254.0, dummyPos), NumericLiteral(BaseDataType.UBYTE, 254.0, dummyPos)) shouldBe false
|
|
|
|
sameValueAndType(NumericLiteral(BaseDataType.UWORD, 12345.0, dummyPos), NumericLiteral(BaseDataType.UWORD, 12345.0, dummyPos)) shouldBe true
|
|
|
|
sameValueAndType(NumericLiteral(BaseDataType.UWORD, 12345.0, dummyPos), NumericLiteral(BaseDataType.FLOAT, 12345.0, dummyPos)) shouldBe false
|
|
|
|
sameValueAndType(NumericLiteral(BaseDataType.FLOAT, 100.0, dummyPos), NumericLiteral(BaseDataType.UBYTE, 100.0, dummyPos)) shouldBe false
|
|
|
|
sameValueAndType(NumericLiteral(BaseDataType.FLOAT, 22239.0, dummyPos), NumericLiteral(BaseDataType.UWORD, 22239.0, dummyPos)) shouldBe false
|
|
|
|
sameValueAndType(NumericLiteral(BaseDataType.FLOAT, 9.99, dummyPos), NumericLiteral(BaseDataType.FLOAT, 9.99, dummyPos)) shouldBe true
|
|
|
|
|
|
|
|
(NumericLiteral(BaseDataType.UBYTE, 100.0, dummyPos) != NumericLiteral(BaseDataType.UBYTE, 101.0, dummyPos)) shouldBe true
|
|
|
|
(NumericLiteral(BaseDataType.UBYTE, 100.0, dummyPos) != NumericLiteral(BaseDataType.UWORD, 101.0, dummyPos)) shouldBe true
|
|
|
|
(NumericLiteral(BaseDataType.UBYTE, 100.0, dummyPos) != NumericLiteral(BaseDataType.FLOAT, 101.0, dummyPos)) shouldBe true
|
|
|
|
(NumericLiteral(BaseDataType.UWORD, 245.0, dummyPos) != NumericLiteral(BaseDataType.UBYTE, 246.0, dummyPos)) shouldBe true
|
|
|
|
(NumericLiteral(BaseDataType.UWORD, 12345.0, dummyPos) != NumericLiteral(BaseDataType.UWORD, 12346.0, dummyPos)) shouldBe true
|
|
|
|
(NumericLiteral(BaseDataType.UWORD, 12345.0, dummyPos) != NumericLiteral(BaseDataType.FLOAT, 12346.0, dummyPos)) shouldBe true
|
|
|
|
(NumericLiteral(BaseDataType.FLOAT, 9.99, dummyPos) != NumericLiteral(BaseDataType.UBYTE, 9.0, dummyPos)) shouldBe true
|
|
|
|
(NumericLiteral(BaseDataType.FLOAT, 9.99, dummyPos) != NumericLiteral(BaseDataType.UWORD, 9.0, dummyPos)) shouldBe true
|
|
|
|
(NumericLiteral(BaseDataType.FLOAT, 9.99, dummyPos) != NumericLiteral(BaseDataType.FLOAT, 9.0, dummyPos)) shouldBe true
|
|
|
|
|
|
|
|
sameValueAndType(NumericLiteral(BaseDataType.UBYTE, 100.0, dummyPos), NumericLiteral(BaseDataType.UBYTE, 101.0, dummyPos)) shouldBe false
|
|
|
|
sameValueAndType(NumericLiteral(BaseDataType.UBYTE, 100.0, dummyPos), NumericLiteral(BaseDataType.UWORD, 101.0, dummyPos)) shouldBe false
|
|
|
|
sameValueAndType(NumericLiteral(BaseDataType.UBYTE, 100.0, dummyPos), NumericLiteral(BaseDataType.FLOAT, 101.0, dummyPos)) shouldBe false
|
|
|
|
sameValueAndType(NumericLiteral(BaseDataType.UWORD, 245.0, dummyPos), NumericLiteral(BaseDataType.UBYTE, 246.0, dummyPos)) shouldBe false
|
|
|
|
sameValueAndType(NumericLiteral(BaseDataType.UWORD, 12345.0, dummyPos), NumericLiteral(BaseDataType.UWORD, 12346.0, dummyPos)) shouldBe false
|
|
|
|
sameValueAndType(NumericLiteral(BaseDataType.UWORD, 12345.0, dummyPos), NumericLiteral(BaseDataType.FLOAT, 12346.0, dummyPos)) shouldBe false
|
|
|
|
sameValueAndType(NumericLiteral(BaseDataType.FLOAT, 9.99, dummyPos), NumericLiteral(BaseDataType.UBYTE, 9.0, dummyPos)) shouldBe false
|
|
|
|
sameValueAndType(NumericLiteral(BaseDataType.FLOAT, 9.99, dummyPos), NumericLiteral(BaseDataType.UWORD, 9.0, dummyPos)) shouldBe false
|
|
|
|
sameValueAndType(NumericLiteral(BaseDataType.FLOAT, 9.99, dummyPos), NumericLiteral(BaseDataType.FLOAT, 9.0, dummyPos)) shouldBe false
|
2022-02-10 23:21:40 +00:00
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
test("testEqualsRef") {
|
2024-08-21 16:23:30 +00:00
|
|
|
(StringLiteral.create("hello", Encoding.PETSCII, dummyPos) == StringLiteral.create("hello", Encoding.PETSCII, dummyPos)) shouldBe true
|
|
|
|
(StringLiteral.create("hello", Encoding.PETSCII, dummyPos) != StringLiteral.create("bye", Encoding.PETSCII, dummyPos)) shouldBe true
|
|
|
|
(StringLiteral.create("hello", Encoding.SCREENCODES, dummyPos) == StringLiteral.create("hello", Encoding.SCREENCODES, dummyPos)) shouldBe true
|
|
|
|
(StringLiteral.create("hello", Encoding.SCREENCODES, dummyPos) != StringLiteral.create("bye", Encoding.SCREENCODES, dummyPos)) shouldBe true
|
|
|
|
(StringLiteral.create("hello", Encoding.SCREENCODES, dummyPos) != StringLiteral.create("hello", Encoding.PETSCII, dummyPos)) shouldBe true
|
2022-02-10 23:21:40 +00:00
|
|
|
|
2024-09-01 18:19:24 +00:00
|
|
|
val lvOne = NumericLiteral(BaseDataType.UBYTE, 1.0, dummyPos)
|
|
|
|
val lvTwo = NumericLiteral(BaseDataType.UBYTE, 2.0, dummyPos)
|
|
|
|
val lvThree = NumericLiteral(BaseDataType.UBYTE, 3.0, dummyPos)
|
|
|
|
val lvOneR = NumericLiteral(BaseDataType.UBYTE, 1.0, dummyPos)
|
|
|
|
val lvTwoR = NumericLiteral(BaseDataType.UBYTE, 2.0, dummyPos)
|
|
|
|
val lvThreeR = NumericLiteral(BaseDataType.UBYTE, 3.0, dummyPos)
|
|
|
|
val lvFour= NumericLiteral(BaseDataType.UBYTE, 4.0, dummyPos)
|
2024-09-08 12:38:34 +00:00
|
|
|
val lv1 = ArrayLiteral(InferredTypes.InferredType.known(DataType.arrayFor(BaseDataType.UBYTE)), arrayOf(lvOne, lvTwo, lvThree), dummyPos)
|
|
|
|
val lv2 = ArrayLiteral(InferredTypes.InferredType.known(DataType.arrayFor(BaseDataType.UBYTE)), arrayOf(lvOneR, lvTwoR, lvThreeR), dummyPos)
|
|
|
|
val lv3 = ArrayLiteral(InferredTypes.InferredType.known(DataType.arrayFor(BaseDataType.UBYTE)), arrayOf(lvOneR, lvTwoR, lvFour), dummyPos)
|
2022-02-10 23:21:40 +00:00
|
|
|
lv1 shouldBe lv2
|
|
|
|
lv1 shouldNotBe lv3
|
|
|
|
}
|
|
|
|
|
|
|
|
test("testGreaterThan") {
|
2024-09-01 18:19:24 +00:00
|
|
|
(NumericLiteral(BaseDataType.UBYTE, 100.0, dummyPos) > NumericLiteral(BaseDataType.UBYTE, 99.0, dummyPos)) shouldBe true
|
|
|
|
(NumericLiteral(BaseDataType.UWORD, 254.0, dummyPos) > NumericLiteral(BaseDataType.UWORD, 253.0, dummyPos)) shouldBe true
|
|
|
|
(NumericLiteral(BaseDataType.FLOAT, 100.0, dummyPos) > NumericLiteral(BaseDataType.FLOAT, 99.9, dummyPos)) shouldBe true
|
2022-02-10 23:21:40 +00:00
|
|
|
|
2024-09-01 18:19:24 +00:00
|
|
|
(NumericLiteral(BaseDataType.UBYTE, 100.0, dummyPos) >= NumericLiteral(BaseDataType.UBYTE, 100.0, dummyPos)) shouldBe true
|
|
|
|
(NumericLiteral(BaseDataType.UWORD, 254.0, dummyPos) >= NumericLiteral(BaseDataType.UWORD, 254.0, dummyPos)) shouldBe true
|
|
|
|
(NumericLiteral(BaseDataType.FLOAT, 100.0, dummyPos) >= NumericLiteral(BaseDataType.FLOAT, 100.0, dummyPos)) shouldBe true
|
2022-02-10 23:21:40 +00:00
|
|
|
|
2024-09-01 18:19:24 +00:00
|
|
|
(NumericLiteral(BaseDataType.UBYTE, 100.0, dummyPos) > NumericLiteral(BaseDataType.UBYTE, 100.0, dummyPos)) shouldBe false
|
|
|
|
(NumericLiteral(BaseDataType.UWORD, 254.0, dummyPos) > NumericLiteral(BaseDataType.UWORD, 254.0, dummyPos)) shouldBe false
|
|
|
|
(NumericLiteral(BaseDataType.FLOAT, 100.0, dummyPos) > NumericLiteral(BaseDataType.FLOAT, 100.0, dummyPos)) shouldBe false
|
2022-02-10 23:21:40 +00:00
|
|
|
|
2024-09-01 18:19:24 +00:00
|
|
|
(NumericLiteral(BaseDataType.UBYTE, 100.0, dummyPos) >= NumericLiteral(BaseDataType.UBYTE, 101.0, dummyPos)) shouldBe false
|
|
|
|
(NumericLiteral(BaseDataType.UWORD, 254.0, dummyPos) >= NumericLiteral(BaseDataType.UWORD, 255.0, dummyPos)) shouldBe false
|
|
|
|
(NumericLiteral(BaseDataType.FLOAT, 100.0, dummyPos) >= NumericLiteral(BaseDataType.FLOAT, 100.1, dummyPos)) shouldBe false
|
2022-02-10 23:21:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
test("testLessThan") {
|
2024-09-01 18:19:24 +00:00
|
|
|
(NumericLiteral(BaseDataType.UBYTE, 100.0, dummyPos) < NumericLiteral(BaseDataType.UBYTE, 101.0, dummyPos)) shouldBe true
|
|
|
|
(NumericLiteral(BaseDataType.UWORD, 254.0, dummyPos) < NumericLiteral(BaseDataType.UWORD, 255.0, dummyPos)) shouldBe true
|
|
|
|
(NumericLiteral(BaseDataType.FLOAT, 100.0, dummyPos) < NumericLiteral(BaseDataType.FLOAT, 100.1, dummyPos)) shouldBe true
|
2022-02-10 23:21:40 +00:00
|
|
|
|
2024-09-01 18:19:24 +00:00
|
|
|
(NumericLiteral(BaseDataType.UBYTE, 100.0, dummyPos) <= NumericLiteral(BaseDataType.UBYTE, 100.0, dummyPos)) shouldBe true
|
|
|
|
(NumericLiteral(BaseDataType.UWORD, 254.0, dummyPos) <= NumericLiteral(BaseDataType.UWORD, 254.0, dummyPos)) shouldBe true
|
|
|
|
(NumericLiteral(BaseDataType.FLOAT, 100.0, dummyPos) <= NumericLiteral(BaseDataType.FLOAT, 100.0, dummyPos)) shouldBe true
|
2022-02-10 23:21:40 +00:00
|
|
|
|
2024-09-01 18:19:24 +00:00
|
|
|
(NumericLiteral(BaseDataType.UBYTE, 100.0, dummyPos) < NumericLiteral(BaseDataType.UBYTE, 100.0, dummyPos)) shouldBe false
|
|
|
|
(NumericLiteral(BaseDataType.UWORD, 254.0, dummyPos) < NumericLiteral(BaseDataType.UWORD, 254.0, dummyPos)) shouldBe false
|
|
|
|
(NumericLiteral(BaseDataType.FLOAT, 100.0, dummyPos) < NumericLiteral(BaseDataType.FLOAT, 100.0, dummyPos)) shouldBe false
|
2022-02-10 23:21:40 +00:00
|
|
|
|
2024-09-01 18:19:24 +00:00
|
|
|
(NumericLiteral(BaseDataType.UBYTE, 100.0, dummyPos) <= NumericLiteral(BaseDataType.UBYTE, 99.0, dummyPos)) shouldBe false
|
|
|
|
(NumericLiteral(BaseDataType.UWORD, 254.0, dummyPos) <= NumericLiteral(BaseDataType.UWORD, 253.0, dummyPos)) shouldBe false
|
|
|
|
(NumericLiteral(BaseDataType.FLOAT, 100.0, dummyPos) <= NumericLiteral(BaseDataType.FLOAT, 99.9, dummyPos)) shouldBe false
|
2022-02-10 23:21:40 +00:00
|
|
|
}
|
|
|
|
|
2022-06-05 13:35:29 +00:00
|
|
|
test("optimalInteger") {
|
2024-09-04 19:49:47 +00:00
|
|
|
NumericLiteral.optimalInteger(10, Position.DUMMY).type shouldBe BaseDataType.UBYTE
|
2022-06-05 13:35:29 +00:00
|
|
|
NumericLiteral.optimalInteger(10, Position.DUMMY).number shouldBe 10.0
|
2024-09-04 19:49:47 +00:00
|
|
|
NumericLiteral.optimalInteger(-10, Position.DUMMY).type shouldBe BaseDataType.BYTE
|
2022-06-05 13:35:29 +00:00
|
|
|
NumericLiteral.optimalInteger(-10, Position.DUMMY).number shouldBe -10.0
|
2024-09-04 19:49:47 +00:00
|
|
|
NumericLiteral.optimalInteger(1000, Position.DUMMY).type shouldBe BaseDataType.UWORD
|
2022-06-05 13:35:29 +00:00
|
|
|
NumericLiteral.optimalInteger(-1000, Position.DUMMY).number shouldBe -1000.0
|
2024-09-04 19:49:47 +00:00
|
|
|
NumericLiteral.optimalInteger(1000u, Position.DUMMY).type shouldBe BaseDataType.UWORD
|
2022-06-05 13:35:29 +00:00
|
|
|
NumericLiteral.optimalInteger(1000u, Position.DUMMY).number shouldBe 1000.0
|
|
|
|
}
|
|
|
|
|
|
|
|
test("optimalNumeric") {
|
2024-09-04 19:49:47 +00:00
|
|
|
NumericLiteral.optimalNumeric(10, Position.DUMMY).type shouldBe BaseDataType.UBYTE
|
2022-06-05 13:35:29 +00:00
|
|
|
NumericLiteral.optimalNumeric(10, Position.DUMMY).number shouldBe 10.0
|
2024-09-04 19:49:47 +00:00
|
|
|
NumericLiteral.optimalNumeric(-10, Position.DUMMY).type shouldBe BaseDataType.BYTE
|
2022-06-05 13:35:29 +00:00
|
|
|
NumericLiteral.optimalNumeric(-10, Position.DUMMY).number shouldBe -10.0
|
2024-09-04 19:49:47 +00:00
|
|
|
NumericLiteral.optimalNumeric(1000, Position.DUMMY).type shouldBe BaseDataType.UWORD
|
2022-06-05 13:35:29 +00:00
|
|
|
NumericLiteral.optimalNumeric(1000, Position.DUMMY).number shouldBe 1000.0
|
2024-09-04 19:49:47 +00:00
|
|
|
NumericLiteral.optimalNumeric(-1000, Position.DUMMY).type shouldBe BaseDataType.WORD
|
2022-06-05 13:35:29 +00:00
|
|
|
NumericLiteral.optimalNumeric(-1000, Position.DUMMY).number shouldBe -1000.0
|
2024-09-04 19:49:47 +00:00
|
|
|
NumericLiteral.optimalNumeric(1.123, Position.DUMMY).type shouldBe BaseDataType.FLOAT
|
2022-06-05 13:35:29 +00:00
|
|
|
NumericLiteral.optimalNumeric(1.123, Position.DUMMY).number shouldBe 1.123
|
2024-09-04 19:49:47 +00:00
|
|
|
NumericLiteral.optimalNumeric(1.0, Position.DUMMY).type shouldBe BaseDataType.UBYTE
|
2022-06-05 13:35:29 +00:00
|
|
|
NumericLiteral.optimalNumeric(1.0, Position.DUMMY).number shouldBe 1.0
|
2024-09-04 19:49:47 +00:00
|
|
|
NumericLiteral.optimalNumeric(-1.0, Position.DUMMY).type shouldBe BaseDataType.BYTE
|
2022-06-05 13:35:29 +00:00
|
|
|
NumericLiteral.optimalNumeric(-1.0, Position.DUMMY).number shouldBe -1.0
|
2024-09-04 19:49:47 +00:00
|
|
|
NumericLiteral.optimalNumeric(1234.0, Position.DUMMY).type shouldBe BaseDataType.UWORD
|
2022-06-05 13:35:29 +00:00
|
|
|
NumericLiteral.optimalNumeric(1234.0, Position.DUMMY).number shouldBe 1234.0
|
2024-09-04 19:49:47 +00:00
|
|
|
NumericLiteral.optimalNumeric(-1234.0, Position.DUMMY).type shouldBe BaseDataType.WORD
|
2022-06-05 13:35:29 +00:00
|
|
|
NumericLiteral.optimalNumeric(-1234.0, Position.DUMMY).number shouldBe -1234.0
|
|
|
|
}
|
2022-02-10 23:21:40 +00:00
|
|
|
})
|