From 48849a0e2ae0ee6a77d0e413fbed6a73a64211e7 Mon Sep 17 00:00:00 2001 From: gumi Date: Sat, 28 Mar 2020 19:28:59 -0400 Subject: add unit tests for octal and binary literals --- npc/dev/test.txt | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'npc') diff --git a/npc/dev/test.txt b/npc/dev/test.txt index a9e78489a..f7f28d622 100644 --- a/npc/dev/test.txt +++ b/npc/dev/test.txt @@ -122,6 +122,13 @@ function script HerculesSelfTestHelper { .once = 1; .errors = 0; + // number literals + callsub(OnCheck, "decimal number literal", 255, 255); + callsub(OnCheck, "hexadecimal number literal", 0xFF, 255); + callsub(OnCheck, "octal number literal", 0o377, 255); + callsub(OnCheck, "binary number literal", 0b11111111, 255); + callsub(OnCheck, "binary literal bitwise OR", 0b11110000 | 0xF, 255); + // Callsub (basic) callsub(OnCheck, "Callsub", 1, 1); callsub(OnCheck, "Callsub (getarg default values)", 1); -- cgit v1.2.3-70-g09d2 From 01dd499bcafa6fd29bfa70c505636a911b5f24a2 Mon Sep 17 00:00:00 2001 From: gumi Date: Sun, 3 May 2020 23:13:16 -0400 Subject: add unit tests for number separators --- npc/dev/test.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'npc') diff --git a/npc/dev/test.txt b/npc/dev/test.txt index f7f28d622..842c90f55 100644 --- a/npc/dev/test.txt +++ b/npc/dev/test.txt @@ -128,6 +128,8 @@ function script HerculesSelfTestHelper { callsub(OnCheck, "octal number literal", 0o377, 255); callsub(OnCheck, "binary number literal", 0b11111111, 255); callsub(OnCheck, "binary literal bitwise OR", 0b11110000 | 0xF, 255); + callsub(OnCheck, "decimal literal with separator", 2_5_5, 255); + callsub(OnCheck, "binary literal with separator", 0b_1111_1111, 255); // Callsub (basic) callsub(OnCheck, "Callsub", 1, 1); -- cgit v1.2.3-70-g09d2