From 8f2ecef3f50b64d12a5bc2c375fe2909e2a1c7e1 Mon Sep 17 00:00:00 2001 From: Justin Webb Date: Fri, 5 Dec 2025 14:53:48 +0100 Subject: [PATCH] Angelscript datatypes unit-test. --- .../Problems/Angelscript/DatatypesTest.as | 27 +++++++++++++++++++ .../Angelscript/DatatypesTest.as.solution | 27 +++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 ServerCodeExciserTest/Problems/Angelscript/DatatypesTest.as create mode 100644 ServerCodeExciserTest/Problems/Angelscript/DatatypesTest.as.solution diff --git a/ServerCodeExciserTest/Problems/Angelscript/DatatypesTest.as b/ServerCodeExciserTest/Problems/Angelscript/DatatypesTest.as new file mode 100644 index 0000000..a6afca0 --- /dev/null +++ b/ServerCodeExciserTest/Problems/Angelscript/DatatypesTest.as @@ -0,0 +1,27 @@ +class UDatatypesTest +{ + void Test() + { + int A = 0; + int8 B = 0; + int16 C = 0; + int32 D = 0; + int64 E = 0; + uint F = 0; + uint8 G = 0; + uint16 H = 0; + uint32 I = 0; + uint64 J = 0; + float K = 0.0f; + float32 L = 0.0f; + float64 M = 0.0; + double N = 0.0; + bool O = true; + + // https://angelscript.hazelight.se/scripting/fname-literals/ + FName P = n"MyName"; + + // https://angelscript.hazelight.se/scripting/format-strings/ + check(true, f"Formatted String: {L:0.1f}\u00B0"); + } +}; diff --git a/ServerCodeExciserTest/Problems/Angelscript/DatatypesTest.as.solution b/ServerCodeExciserTest/Problems/Angelscript/DatatypesTest.as.solution new file mode 100644 index 0000000..a6afca0 --- /dev/null +++ b/ServerCodeExciserTest/Problems/Angelscript/DatatypesTest.as.solution @@ -0,0 +1,27 @@ +class UDatatypesTest +{ + void Test() + { + int A = 0; + int8 B = 0; + int16 C = 0; + int32 D = 0; + int64 E = 0; + uint F = 0; + uint8 G = 0; + uint16 H = 0; + uint32 I = 0; + uint64 J = 0; + float K = 0.0f; + float32 L = 0.0f; + float64 M = 0.0; + double N = 0.0; + bool O = true; + + // https://angelscript.hazelight.se/scripting/fname-literals/ + FName P = n"MyName"; + + // https://angelscript.hazelight.se/scripting/format-strings/ + check(true, f"Formatted String: {L:0.1f}\u00B0"); + } +};