From ae505188fc9892ec91f75a659b259b9d945b61f9 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 23 Feb 2026 02:24:48 +0300 Subject: [PATCH] tests: move fixtures to dedicated dir Signed-off-by: NotAShelf Change-Id: I9d6ce6a264780f215b1b57d947b5264c6a6a6964 --- tests/block_comments.nix | 12 -- tests/{ => fixtures}/ancient_let.nix | 0 tests/{ => fixtures}/attrset.nix | 0 tests/{ => fixtures}/attrset_var.nix | 0 tests/fixtures/block_comments.nix | 24 ++++ tests/{ => fixtures}/comparison.nix | 0 tests/fixtures/dynamic_attr_full.nix | 14 ++ tests/{ => fixtures}/dynamic_attrs.nix | 0 tests/{ => fixtures}/float_test.nix | 0 tests/{ => fixtures}/home_path.nix | 0 tests/{ => fixtures}/if.nix | 0 tests/{ => fixtures}/import_lookup.nix | 0 tests/{ => fixtures}/import_simple.nix | 4 +- tests/{ => fixtures}/indented_string.nix | 0 tests/{ => fixtures}/inherit.nix | 0 tests/{ => fixtures}/inherit_from.nix | 0 tests/{ => fixtures}/inherit_simple.nix | 0 tests/{ => fixtures}/lambda_pattern.nix | 0 tests/{ => fixtures}/let.nix | 0 tests/{ => fixtures}/list_concat.nix | 0 tests/fixtures/list_simple.nix | 8 ++ tests/{ => fixtures}/logical.nix | 0 tests/{ => fixtures}/lookup_path.nix | 3 +- tests/{ => fixtures}/lookup_path_nested.nix | 0 tests/{ => fixtures}/merge.nix | 0 tests/{ => fixtures}/nested_attrs.nix | 0 tests/{ => fixtures}/operators.nix | 0 tests/{ => fixtures}/or_in_attrset.nix | 2 +- tests/fixtures/or_simple.nix | 5 + tests/{ => fixtures}/path_concat.nix | 0 tests/{ => fixtures}/precedence.nix | 0 tests/{ => fixtures}/select_or_default.nix | 5 +- tests/{ => fixtures}/shortcircuit.nix | 0 tests/{ => fixtures}/shortcircuit2.nix | 0 tests/{ => fixtures}/simple.nix | 0 tests/{ => fixtures}/simple_op.nix | 0 tests/{ => fixtures}/string_interp.nix | 0 tests/{ => fixtures}/unary.nix | 0 tests/{ => fixtures}/uri_test.nix | 0 tests/or_simple.nix | 4 - tests/regression_test.cpp | 147 ++++++++++---------- 41 files changed, 134 insertions(+), 94 deletions(-) delete mode 100644 tests/block_comments.nix rename tests/{ => fixtures}/ancient_let.nix (100%) rename tests/{ => fixtures}/attrset.nix (100%) rename tests/{ => fixtures}/attrset_var.nix (100%) create mode 100644 tests/fixtures/block_comments.nix rename tests/{ => fixtures}/comparison.nix (100%) create mode 100644 tests/fixtures/dynamic_attr_full.nix rename tests/{ => fixtures}/dynamic_attrs.nix (100%) rename tests/{ => fixtures}/float_test.nix (100%) rename tests/{ => fixtures}/home_path.nix (100%) rename tests/{ => fixtures}/if.nix (100%) rename tests/{ => fixtures}/import_lookup.nix (100%) rename tests/{ => fixtures}/import_simple.nix (99%) rename tests/{ => fixtures}/indented_string.nix (100%) rename tests/{ => fixtures}/inherit.nix (100%) rename tests/{ => fixtures}/inherit_from.nix (100%) rename tests/{ => fixtures}/inherit_simple.nix (100%) rename tests/{ => fixtures}/lambda_pattern.nix (100%) rename tests/{ => fixtures}/let.nix (100%) rename tests/{ => fixtures}/list_concat.nix (100%) create mode 100644 tests/fixtures/list_simple.nix rename tests/{ => fixtures}/logical.nix (100%) rename tests/{ => fixtures}/lookup_path.nix (99%) rename tests/{ => fixtures}/lookup_path_nested.nix (100%) rename tests/{ => fixtures}/merge.nix (100%) rename tests/{ => fixtures}/nested_attrs.nix (100%) rename tests/{ => fixtures}/operators.nix (100%) rename tests/{ => fixtures}/or_in_attrset.nix (75%) create mode 100644 tests/fixtures/or_simple.nix rename tests/{ => fixtures}/path_concat.nix (100%) rename tests/{ => fixtures}/precedence.nix (100%) rename tests/{ => fixtures}/select_or_default.nix (90%) rename tests/{ => fixtures}/shortcircuit.nix (100%) rename tests/{ => fixtures}/shortcircuit2.nix (100%) rename tests/{ => fixtures}/simple.nix (100%) rename tests/{ => fixtures}/simple_op.nix (100%) rename tests/{ => fixtures}/string_interp.nix (100%) rename tests/{ => fixtures}/unary.nix (100%) rename tests/{ => fixtures}/uri_test.nix (100%) delete mode 100644 tests/or_simple.nix diff --git a/tests/block_comments.nix b/tests/block_comments.nix deleted file mode 100644 index b5de60f..0000000 --- a/tests/block_comments.nix +++ /dev/null @@ -1,12 +0,0 @@ -# Test block comments /* */ -/* This is a block comment */ -let - x = 42; /* inline block comment */ - /* Multi-line - block - comment */ - y = 100; -in -/* Comment before expression */ -x + y -/* Trailing comment */ diff --git a/tests/ancient_let.nix b/tests/fixtures/ancient_let.nix similarity index 100% rename from tests/ancient_let.nix rename to tests/fixtures/ancient_let.nix diff --git a/tests/attrset.nix b/tests/fixtures/attrset.nix similarity index 100% rename from tests/attrset.nix rename to tests/fixtures/attrset.nix diff --git a/tests/attrset_var.nix b/tests/fixtures/attrset_var.nix similarity index 100% rename from tests/attrset_var.nix rename to tests/fixtures/attrset_var.nix diff --git a/tests/fixtures/block_comments.nix b/tests/fixtures/block_comments.nix new file mode 100644 index 0000000..301297d --- /dev/null +++ b/tests/fixtures/block_comments.nix @@ -0,0 +1,24 @@ +# Test block comments /* */ +/* +This is a block comment +*/ +let + x = 42; + /* + inline block comment + */ + /* + Multi-line + block + comment + */ + y = 100; +in + /* + Comment before expression + */ + x + y +/* +Trailing comment +*/ + diff --git a/tests/comparison.nix b/tests/fixtures/comparison.nix similarity index 100% rename from tests/comparison.nix rename to tests/fixtures/comparison.nix diff --git a/tests/fixtures/dynamic_attr_full.nix b/tests/fixtures/dynamic_attr_full.nix new file mode 100644 index 0000000..3c7b39b --- /dev/null +++ b/tests/fixtures/dynamic_attr_full.nix @@ -0,0 +1,14 @@ +# Test dynamic attribute names +let + key = "mykey"; + value = 42; +in { + # Dynamic attribute with string interpolation + "${key}" = value; + + # Another dynamic attribute + "${key}_suffix" = value + 1; + + # Static attribute for comparison + static = 100; +} diff --git a/tests/dynamic_attrs.nix b/tests/fixtures/dynamic_attrs.nix similarity index 100% rename from tests/dynamic_attrs.nix rename to tests/fixtures/dynamic_attrs.nix diff --git a/tests/float_test.nix b/tests/fixtures/float_test.nix similarity index 100% rename from tests/float_test.nix rename to tests/fixtures/float_test.nix diff --git a/tests/home_path.nix b/tests/fixtures/home_path.nix similarity index 100% rename from tests/home_path.nix rename to tests/fixtures/home_path.nix diff --git a/tests/if.nix b/tests/fixtures/if.nix similarity index 100% rename from tests/if.nix rename to tests/fixtures/if.nix diff --git a/tests/import_lookup.nix b/tests/fixtures/import_lookup.nix similarity index 100% rename from tests/import_lookup.nix rename to tests/fixtures/import_lookup.nix diff --git a/tests/import_simple.nix b/tests/fixtures/import_simple.nix similarity index 99% rename from tests/import_simple.nix rename to tests/fixtures/import_simple.nix index 023b49d..1e024cc 100644 --- a/tests/import_simple.nix +++ b/tests/fixtures/import_simple.nix @@ -1,11 +1,9 @@ # Test import expression # Import evaluates the file and returns its value - # Import a file that returns a simple value (42) import ./simple.nix - # Can also import lookup paths: # import { } - # Import with path expressions: # import (./dir + "/file.nix") + diff --git a/tests/indented_string.nix b/tests/fixtures/indented_string.nix similarity index 100% rename from tests/indented_string.nix rename to tests/fixtures/indented_string.nix diff --git a/tests/inherit.nix b/tests/fixtures/inherit.nix similarity index 100% rename from tests/inherit.nix rename to tests/fixtures/inherit.nix diff --git a/tests/inherit_from.nix b/tests/fixtures/inherit_from.nix similarity index 100% rename from tests/inherit_from.nix rename to tests/fixtures/inherit_from.nix diff --git a/tests/inherit_simple.nix b/tests/fixtures/inherit_simple.nix similarity index 100% rename from tests/inherit_simple.nix rename to tests/fixtures/inherit_simple.nix diff --git a/tests/lambda_pattern.nix b/tests/fixtures/lambda_pattern.nix similarity index 100% rename from tests/lambda_pattern.nix rename to tests/fixtures/lambda_pattern.nix diff --git a/tests/let.nix b/tests/fixtures/let.nix similarity index 100% rename from tests/let.nix rename to tests/fixtures/let.nix diff --git a/tests/list_concat.nix b/tests/fixtures/list_concat.nix similarity index 100% rename from tests/list_concat.nix rename to tests/fixtures/list_concat.nix diff --git a/tests/fixtures/list_simple.nix b/tests/fixtures/list_simple.nix new file mode 100644 index 0000000..7167967 --- /dev/null +++ b/tests/fixtures/list_simple.nix @@ -0,0 +1,8 @@ +# Test basic list support +let + x = [1 2 3]; + y = [4 5 6]; + z = x ++ y; # List concatenation +in { + inherit x y z; +} diff --git a/tests/logical.nix b/tests/fixtures/logical.nix similarity index 100% rename from tests/logical.nix rename to tests/fixtures/logical.nix diff --git a/tests/lookup_path.nix b/tests/fixtures/lookup_path.nix similarity index 99% rename from tests/lookup_path.nix rename to tests/fixtures/lookup_path.nix index e8bb4ca..a770360 100644 --- a/tests/lookup_path.nix +++ b/tests/fixtures/lookup_path.nix @@ -1,9 +1,8 @@ # Test lookup path syntax # Lookup paths resolve via NIX_PATH environment variable # Example: -> /nix/var/nix/profiles/per-user/root/channels/nixpkgs - # Simple lookup path - # Nested lookup path (common pattern) # + diff --git a/tests/lookup_path_nested.nix b/tests/fixtures/lookup_path_nested.nix similarity index 100% rename from tests/lookup_path_nested.nix rename to tests/fixtures/lookup_path_nested.nix diff --git a/tests/merge.nix b/tests/fixtures/merge.nix similarity index 100% rename from tests/merge.nix rename to tests/fixtures/merge.nix diff --git a/tests/nested_attrs.nix b/tests/fixtures/nested_attrs.nix similarity index 100% rename from tests/nested_attrs.nix rename to tests/fixtures/nested_attrs.nix diff --git a/tests/operators.nix b/tests/fixtures/operators.nix similarity index 100% rename from tests/operators.nix rename to tests/fixtures/operators.nix diff --git a/tests/or_in_attrset.nix b/tests/fixtures/or_in_attrset.nix similarity index 75% rename from tests/or_in_attrset.nix rename to tests/fixtures/or_in_attrset.nix index 406149b..d1ab7f9 100644 --- a/tests/or_in_attrset.nix +++ b/tests/fixtures/or_in_attrset.nix @@ -1,6 +1,6 @@ # Test 'or' in attrset context let - attrs = { a = 1; }; + attrs = {a = 1;}; in { test = attrs.a or 999; } diff --git a/tests/fixtures/or_simple.nix b/tests/fixtures/or_simple.nix new file mode 100644 index 0000000..d4de5be --- /dev/null +++ b/tests/fixtures/or_simple.nix @@ -0,0 +1,5 @@ +# Simplest 'or' test +let + x = {a = 1;}; +in + x.a or 2 diff --git a/tests/path_concat.nix b/tests/fixtures/path_concat.nix similarity index 100% rename from tests/path_concat.nix rename to tests/fixtures/path_concat.nix diff --git a/tests/precedence.nix b/tests/fixtures/precedence.nix similarity index 100% rename from tests/precedence.nix rename to tests/fixtures/precedence.nix diff --git a/tests/select_or_default.nix b/tests/fixtures/select_or_default.nix similarity index 90% rename from tests/select_or_default.nix rename to tests/fixtures/select_or_default.nix index df91875..6144ff5 100644 --- a/tests/select_or_default.nix +++ b/tests/fixtures/select_or_default.nix @@ -1,6 +1,9 @@ # Test selection with 'or' default let - attrs = { a = 1; b = 2; }; + attrs = { + a = 1; + b = 2; + }; in { # Attribute exists - should use value from attrs has_attr = attrs.a or 999; diff --git a/tests/shortcircuit.nix b/tests/fixtures/shortcircuit.nix similarity index 100% rename from tests/shortcircuit.nix rename to tests/fixtures/shortcircuit.nix diff --git a/tests/shortcircuit2.nix b/tests/fixtures/shortcircuit2.nix similarity index 100% rename from tests/shortcircuit2.nix rename to tests/fixtures/shortcircuit2.nix diff --git a/tests/simple.nix b/tests/fixtures/simple.nix similarity index 100% rename from tests/simple.nix rename to tests/fixtures/simple.nix diff --git a/tests/simple_op.nix b/tests/fixtures/simple_op.nix similarity index 100% rename from tests/simple_op.nix rename to tests/fixtures/simple_op.nix diff --git a/tests/string_interp.nix b/tests/fixtures/string_interp.nix similarity index 100% rename from tests/string_interp.nix rename to tests/fixtures/string_interp.nix diff --git a/tests/unary.nix b/tests/fixtures/unary.nix similarity index 100% rename from tests/unary.nix rename to tests/fixtures/unary.nix diff --git a/tests/uri_test.nix b/tests/fixtures/uri_test.nix similarity index 100% rename from tests/uri_test.nix rename to tests/fixtures/uri_test.nix diff --git a/tests/or_simple.nix b/tests/or_simple.nix deleted file mode 100644 index 6025a4d..0000000 --- a/tests/or_simple.nix +++ /dev/null @@ -1,4 +0,0 @@ -# Simplest 'or' test -let - x = { a = 1; }; -in x.a or 2 diff --git a/tests/regression_test.cpp b/tests/regression_test.cpp index 1b4c4ce..f9f9914 100644 --- a/tests/regression_test.cpp +++ b/tests/regression_test.cpp @@ -1,3 +1,4 @@ +#include "irc/parser.h" #include "irc/serializer.h" #include "irc/types.h" #include @@ -7,21 +8,21 @@ using namespace nix_irc; int failures = 0; -#define TEST_CHECK(cond, msg) \ - do { \ - if (!(cond)) { \ - std::cerr << " FAIL: " << msg << std::endl; \ - failures++; \ - } else { \ - std::cout << " PASS: " << msg << std::endl; \ - } \ +#define TEST_CHECK(cond, msg) \ + do { \ + if (!(cond)) { \ + std::cerr << " FAIL: " << msg << std::endl; \ + failures++; \ + } else { \ + std::cout << " PASS: " << msg << std::endl; \ + } \ } while (0) #define TEST_PASS(msg) std::cout << " PASS: " << msg << std::endl -#define TEST_FAIL(msg) \ - do { \ - std::cerr << " FAIL: " << msg << std::endl; \ - failures++; \ +#define TEST_FAIL(msg) \ + do { \ + std::cerr << " FAIL: " << msg << std::endl; \ + failures++; \ } while (0) void test_enum_compatibility() { @@ -30,33 +31,28 @@ void test_enum_compatibility() { if (static_cast(NodeType::WITH) == 0x32) { std::cout << " PASS: WITH has correct value 0x32" << std::endl; } else { - std::cerr << " FAIL: WITH should be 0x32, got " - << static_cast(NodeType::WITH) << std::endl; + std::cerr << " FAIL: WITH should be 0x32, got " << static_cast(NodeType::WITH) + << std::endl; } if (static_cast(NodeType::HAS_ATTR) == 0x34) { - std::cout << " PASS: HAS_ATTR has value 0x34 (new slot after WITH bump)" - << std::endl; + std::cout << " PASS: HAS_ATTR has value 0x34 (new slot after WITH bump)" << std::endl; } else if (static_cast(NodeType::HAS_ATTR) == 0x33 && static_cast(NodeType::WITH) == 0x32) { std::cout << " PASS: HAS_ATTR has value 0x33 (restored original with WITH " "at 0x32)" << std::endl; } else { - std::cerr << " FAIL: HAS_ATTR value is " - << static_cast(NodeType::HAS_ATTR) + std::cerr << " FAIL: HAS_ATTR value is " << static_cast(NodeType::HAS_ATTR) << " (expected 0x34 or 0x33 with WITH=0x32)" << std::endl; } if (IR_VERSION == 2) { - std::cout << " PASS: IR_VERSION bumped to 2 for breaking change" - << std::endl; + std::cout << " PASS: IR_VERSION bumped to 2 for breaking change" << std::endl; } else if (static_cast(NodeType::WITH) == 0x32) { - std::cout << " PASS: IR_VERSION unchanged but WITH restored to 0x32" - << std::endl; + std::cout << " PASS: IR_VERSION unchanged but WITH restored to 0x32" << std::endl; } else { - std::cerr << " FAIL: Either bump IR_VERSION or fix enum values" - << std::endl; + std::cerr << " FAIL: Either bump IR_VERSION or fix enum values" << std::endl; } } @@ -80,19 +76,16 @@ void test_serializer_select_with_default() { Deserializer deser; auto loaded = deser.deserialize(bytes); - auto *loaded_select = loaded.entry->get_if(); - if (loaded_select && loaded_select->default_expr && - *loaded_select->default_expr) { - auto *def_val = (*loaded_select->default_expr)->get_if(); + auto* loaded_select = loaded.entry->get_if(); + if (loaded_select && loaded_select->default_expr && *loaded_select->default_expr) { + auto* def_val = (*loaded_select->default_expr)->get_if(); if (def_val && def_val->value == 100) { - std::cout << " PASS: SELECT with default_expr round-trips correctly" - << std::endl; + std::cout << " PASS: SELECT with default_expr round-trips correctly" << std::endl; } else { std::cerr << " FAIL: default_expr value incorrect" << std::endl; } } else { - std::cerr << " FAIL: default_expr not deserialized (missing u8 flag read)" - << std::endl; + std::cerr << " FAIL: default_expr not deserialized (missing u8 flag read)" << std::endl; } } @@ -114,11 +107,9 @@ void test_serializer_select_without_default() { Deserializer deser; auto loaded = deser.deserialize(bytes); - auto *loaded_select = loaded.entry->get_if(); - if (loaded_select && - (!loaded_select->default_expr || !*loaded_select->default_expr)) { - std::cout << " PASS: SELECT without default_expr round-trips correctly" - << std::endl; + auto* loaded_select = loaded.entry->get_if(); + if (loaded_select && (!loaded_select->default_expr || !*loaded_select->default_expr)) { + std::cout << " PASS: SELECT without default_expr round-trips correctly" << std::endl; } else { std::cerr << " FAIL: default_expr should be null/absent" << std::endl; } @@ -127,34 +118,53 @@ void test_serializer_select_without_default() { void test_parser_brace_depth_in_strings() { std::cout << "> Parser brace depth handling in strings..." << std::endl; - std::string test_input = R"( - let s = "test}"; in ${s} - )"; + std::string test_input = R"(let s = "test}"; in s)"; - std::cout << " Test input contains '}' inside string - should not end " - "interpolation" - << std::endl; - std::cout << " NOTE: This test requires running through actual parser" - << std::endl; + try { + Parser parser; + auto ast = parser.parse(test_input); + TEST_PASS("Brace inside string does not confuse parser"); + } catch (const std::exception& e) { + TEST_FAIL("Parser should handle '}' inside strings"); + } } void test_parser_has_ellipsis_usage() { std::cout << "> Parser has_ellipsis usage..." << std::endl; - std::cout << " NOTE: LambdaNode should have strict_pattern field when " - "has_ellipsis is false" - << std::endl; - std::cout << " This requires checking the parser output for strict patterns" - << std::endl; + std::string with_ellipsis = "{ a, ... }: a"; + std::string without_ellipsis = "{ a, b }: a + b"; + + try { + Parser parser1; + auto ast1 = parser1.parse(with_ellipsis); + TEST_PASS("Pattern with ellipsis parses correctly"); + + Parser parser2; + auto ast2 = parser2.parse(without_ellipsis); + TEST_PASS("Pattern without ellipsis parses correctly"); + } catch (const std::exception& e) { + TEST_FAIL("Pattern parsing failed"); + } } void test_parser_expect_in_speculative_parsing() { std::cout << "> Parser expect() in speculative parsing..." << std::endl; - std::cout << " NOTE: try_parse_lambda should not throw on non-lambda input" - << std::endl; - std::cout << " This requires testing parser with invalid lambda patterns" - << std::endl; + std::string not_a_lambda = "1 + 2"; + std::string actual_lambda = "x: x + 1"; + + try { + Parser parser1; + auto ast1 = parser1.parse(not_a_lambda); + TEST_PASS("Non-lambda input does not cause parser to throw"); + + Parser parser2; + auto ast2 = parser2.parse(actual_lambda); + TEST_PASS("Actual lambda parses correctly"); + } catch (const std::exception& e) { + TEST_FAIL("Parser should handle both lambda and non-lambda input"); + } } void test_lookup_path_node() { @@ -170,10 +180,9 @@ void test_lookup_path_node() { Deserializer deser; auto loaded = deser.deserialize(bytes); - auto *loaded_lookup = loaded.entry->get_if(); + auto* loaded_lookup = loaded.entry->get_if(); TEST_CHECK(loaded_lookup != nullptr, "Deserialized node is ConstLookupPathNode"); - TEST_CHECK(loaded_lookup && loaded_lookup->value == "nixpkgs", - "Lookup path value is 'nixpkgs'"); + TEST_CHECK(loaded_lookup && loaded_lookup->value == "nixpkgs", "Lookup path value is 'nixpkgs'"); } void test_import_node() { @@ -190,16 +199,14 @@ void test_import_node() { Deserializer deser; auto loaded = deser.deserialize(bytes); - auto *loaded_import = loaded.entry->get_if(); + auto* loaded_import = loaded.entry->get_if(); TEST_CHECK(loaded_import != nullptr, "Deserialized node is ImportNode"); - TEST_CHECK(loaded_import && loaded_import->path != nullptr, - "Import node has path"); + TEST_CHECK(loaded_import && loaded_import->path != nullptr, "Import node has path"); if (loaded_import && loaded_import->path) { - auto *path_node = loaded_import->path->get_if(); + auto* path_node = loaded_import->path->get_if(); TEST_CHECK(path_node != nullptr, "Import path is ConstPathNode"); - TEST_CHECK(path_node && path_node->value == "./test.nix", - "Import path value is './test.nix'"); + TEST_CHECK(path_node && path_node->value == "./test.nix", "Import path value is './test.nix'"); } } @@ -217,14 +224,13 @@ void test_import_with_lookup_path() { Deserializer deser; auto loaded = deser.deserialize(bytes); - auto *loaded_import = loaded.entry->get_if(); + auto* loaded_import = loaded.entry->get_if(); TEST_CHECK(loaded_import != nullptr, "Deserialized node is ImportNode"); if (loaded_import && loaded_import->path) { - auto *lookup_node = loaded_import->path->get_if(); + auto* lookup_node = loaded_import->path->get_if(); TEST_CHECK(lookup_node != nullptr, "Import path is ConstLookupPathNode"); - TEST_CHECK(lookup_node && lookup_node->value == "nixpkgs", - "Lookup path value is 'nixpkgs'"); + TEST_CHECK(lookup_node && lookup_node->value == "nixpkgs", "Lookup path value is 'nixpkgs'"); } } @@ -241,7 +247,7 @@ void test_uri_node() { Deserializer deser; auto loaded = deser.deserialize(bytes); - auto *loaded_uri = loaded.entry->get_if(); + auto* loaded_uri = loaded.entry->get_if(); TEST_CHECK(loaded_uri != nullptr, "Deserialized node is ConstURINode"); TEST_CHECK(loaded_uri && loaded_uri->value == "https://example.com", "URI value is 'https://example.com'"); @@ -260,10 +266,9 @@ void test_float_node() { Deserializer deser; auto loaded = deser.deserialize(bytes); - auto *loaded_float = loaded.entry->get_if(); + auto* loaded_float = loaded.entry->get_if(); TEST_CHECK(loaded_float != nullptr, "Deserialized node is ConstFloatNode"); - TEST_CHECK(loaded_float && loaded_float->value > 3.14 && - loaded_float->value < 3.15, + TEST_CHECK(loaded_float && loaded_float->value > 3.14 && loaded_float->value < 3.15, "Float value is approximately 3.14159"); }