From 61cc1c8624cdf2ef56b807c70f76dd96cc0ebcb7 Mon Sep 17 00:00:00 2001 From: abaire Date: Thu, 28 Jan 2021 12:48:12 -0800 Subject: Relaxes Node naming constraints in glTF documents to match the Editor. --- tests/test_string.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests') diff --git a/tests/test_string.h b/tests/test_string.h index cc3152203e..6d630bde1c 100644 --- a/tests/test_string.h +++ b/tests/test_string.h @@ -1272,6 +1272,20 @@ TEST_CASE("[String] humanize_size") { CHECK(String::humanize_size(100523550) == "95.86 MiB"); CHECK(String::humanize_size(5345555000) == "4.97 GiB"); } + +TEST_CASE("[String] validate_node_name") { + String numeric_only = "12345"; + CHECK(numeric_only.validate_node_name() == "12345"); + + String name_with_spaces = "Name with spaces"; + CHECK(name_with_spaces.validate_node_name() == "Name with spaces"); + + String name_with_kana = "Name with kana ゴドツ"; + CHECK(name_with_kana.validate_node_name() == "Name with kana ゴドツ"); + + String name_with_invalid_chars = "Name with invalid characters :.@removed!"; + CHECK(name_with_invalid_chars.validate_node_name() == "Name with invalid characters removed!"); +} } // namespace TestString #endif // TEST_STRING_H -- cgit v1.2.3