diff options
Diffstat (limited to 'test/integrations/anonymous_parsed')
-rw-r--r-- | test/integrations/anonymous_parsed/input.fdl | 11 | ||||
-rwxr-xr-x | test/integrations/anonymous_parsed/test.sh | 17 |
2 files changed, 28 insertions, 0 deletions
diff --git a/test/integrations/anonymous_parsed/input.fdl b/test/integrations/anonymous_parsed/input.fdl new file mode 100644 index 0000000..316c631 --- /dev/null +++ b/test/integrations/anonymous_parsed/input.fdl @@ -0,0 +1,11 @@ +package fiddle.test { + type test_type : struct { + reg test_reg(32) : struct { + test_bits : enum (1) { + on = 0b1, + off = 0b0, + }; + reserved(31); + }; + }; +}; diff --git a/test/integrations/anonymous_parsed/test.sh b/test/integrations/anonymous_parsed/test.sh new file mode 100755 index 0000000..9bcb6a6 --- /dev/null +++ b/test/integrations/anonymous_parsed/test.sh @@ -0,0 +1,17 @@ +#!/bin/bash +source "$(git rev-parse --show-toplevel)/test/integrations/common.sh" + +output=$( + stack run -- --dump-parsed input.fdl | + jq '.. + | objects + | select(._con == "RegisterBitsAnonymousType") + | .anonBitsType + .anonEnumBody[0] + .enumConsts[0] + .directedSubtree + .enumConstIdent') + +assert_eq "$output" '"on"' + +finish |