Skip to content

Commit 89f1c8e

Browse files
author
Marcin Radomski
committed
Update expected value in generated_code_debug_prints_correctly test
In bitflags v2, the debug string representation of enum values is different than it was in v1: Blue -> Color(Blue) (empty) -> LongEnum(0x0) This change adjusts the expected test value. Signed-off-by: Marcin Radomski <dextero@google.com>
1 parent 7691730 commit 89f1c8e

File tree

1 file changed

+36
-35
lines changed

1 file changed

+36
-35
lines changed

tests/rust_usage_test/tests/integration_test.rs

Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,55 +1767,56 @@ mod write_and_read_examples {
17671767
assert_eq!(
17681768
format!("{:.5?}", &m),
17691769
"Monster { pos: Some(Vec3 { x: 1.00000, y: 2.00000, z: 3.00000, \
1770-
test1: 3.00000, test2: Green, test3: Test { a: 5, b: 6 } }), \
1771-
mana: 150, hp: 80, name: \"MyMonster\", \
1772-
inventory: Some([0, 1, 2, 3, 4]), color: Blue, test_type: Monster, \
1773-
test: Monster { pos: None, mana: 150, hp: 100, name: \"Fred\", \
1774-
inventory: None, color: Blue, test_type: NONE, test: None, \
1775-
test4: None, testarrayofstring: None, testarrayoftables: None, \
1776-
enemy: None, testnestedflatbuffer: None, testempty: None, \
1777-
testbool: false, testhashs32_fnv1: 0, testhashu32_fnv1: 0, \
1778-
testhashs64_fnv1: 0, testhashu64_fnv1: 0, testhashs32_fnv1a: 0, \
1779-
testhashu32_fnv1a: 0, testhashs64_fnv1a: 0, testhashu64_fnv1a: 0, \
1780-
testarrayofbools: None, testf: 3.14159, testf2: 3.00000, testf3: 0.00000, \
1781-
testarrayofstring2: None, testarrayofsortedstruct: None, flex: None, \
1782-
test5: None, vector_of_longs: None, vector_of_doubles: None, \
1770+
test1: 3.00000, test2: Color(Green), test3: Test { a: 5, b: 6 } \
1771+
}), mana: 150, hp: 80, name: \"MyMonster\", inventory: Some([0, 1, \
1772+
2, 3, 4]), color: Color(Blue), test_type: Monster, test: Monster { \
1773+
pos: None, mana: 150, hp: 100, name: \"Fred\", inventory: None, \
1774+
color: Color(Blue), test_type: NONE, test: None, test4: None, \
1775+
testarrayofstring: None, testarrayoftables: None, enemy: None, \
1776+
testnestedflatbuffer: None, testempty: None, testbool: false, \
1777+
testhashs32_fnv1: 0, testhashu32_fnv1: 0, testhashs64_fnv1: 0, \
1778+
testhashu64_fnv1: 0, testhashs32_fnv1a: 0, testhashu32_fnv1a: 0, \
1779+
testhashs64_fnv1a: 0, testhashu64_fnv1a: 0, testarrayofbools: \
1780+
None, testf: 3.14159, testf2: 3.00000, testf3: 0.00000, \
1781+
testarrayofstring2: None, testarrayofsortedstruct: None, flex: \
1782+
None, test5: None, vector_of_longs: None, vector_of_doubles: None, \
17831783
parent_namespace_test: None, vector_of_referrables: None, \
17841784
single_weak_reference: 0, vector_of_weak_references: None, \
17851785
vector_of_strong_referrables: None, co_owning_reference: 0, \
17861786
vector_of_co_owning_references: None, non_owning_reference: 0, \
17871787
vector_of_non_owning_references: None, any_unique_type: NONE, \
17881788
any_unique: None, any_ambiguous_type: NONE, any_ambiguous: None, \
17891789
vector_of_enums: None, signed_enum: None, \
1790-
testrequirednestedflatbuffer: None, scalar_key_sorted_tables: None, \
1791-
native_inline: None, long_enum_non_enum_default: (empty), \
1792-
long_enum_normal_default: LongOne, nan_default: NaN, inf_default: \
1793-
inf, positive_inf_default: inf, infinity_default: inf, \
1794-
positive_infinity_default: inf, negative_inf_default: -inf, \
1795-
negative_infinity_default: -inf, double_inf_default: inf }, \
1796-
test4: Some([Test { a: 10, b: 20 }, Test { a: 30, b: 40 }]), \
1797-
testarrayofstring: Some([\"test1\", \"test2\"]), \
1798-
testarrayoftables: None, enemy: None, testnestedflatbuffer: None, \
1799-
testempty: None, testbool: false, testhashs32_fnv1: 0, \
1800-
testhashu32_fnv1: 0, testhashs64_fnv1: 0, testhashu64_fnv1: 0, \
1801-
testhashs32_fnv1a: 0, testhashu32_fnv1a: 0, testhashs64_fnv1a: 0, \
1802-
testhashu64_fnv1a: 0, testarrayofbools: None, testf: 3.14159, \
1803-
testf2: 3.00000, testf3: 0.00000, testarrayofstring2: None, \
1804-
testarrayofsortedstruct: None, flex: None, test5: None, \
1805-
vector_of_longs: None, vector_of_doubles: None, \
1790+
testrequirednestedflatbuffer: None, scalar_key_sorted_tables: \
1791+
None, native_inline: None, long_enum_non_enum_default: \
1792+
LongEnum(0x0), long_enum_normal_default: LongEnum(LongOne), \
1793+
nan_default: NaN, inf_default: inf, positive_inf_default: inf, \
1794+
infinity_default: inf, positive_infinity_default: inf, \
1795+
negative_inf_default: -inf, negative_infinity_default: -inf, \
1796+
double_inf_default: inf }, test4: Some([Test { a: 10, b: 20 }, \
1797+
Test { a: 30, b: 40 }]), testarrayofstring: Some([\"test1\", \
1798+
\"test2\"]), testarrayoftables: None, enemy: None, \
1799+
testnestedflatbuffer: None, testempty: None, testbool: false, \
1800+
testhashs32_fnv1: 0, testhashu32_fnv1: 0, testhashs64_fnv1: 0, \
1801+
testhashu64_fnv1: 0, testhashs32_fnv1a: 0, testhashu32_fnv1a: 0, \
1802+
testhashs64_fnv1a: 0, testhashu64_fnv1a: 0, testarrayofbools: \
1803+
None, testf: 3.14159, testf2: 3.00000, testf3: 0.00000, \
1804+
testarrayofstring2: None, testarrayofsortedstruct: None, flex: \
1805+
None, test5: None, vector_of_longs: None, vector_of_doubles: None, \
18061806
parent_namespace_test: None, vector_of_referrables: None, \
18071807
single_weak_reference: 0, vector_of_weak_references: None, \
18081808
vector_of_strong_referrables: None, co_owning_reference: 0, \
18091809
vector_of_co_owning_references: None, non_owning_reference: 0, \
18101810
vector_of_non_owning_references: None, any_unique_type: NONE, \
18111811
any_unique: None, any_ambiguous_type: NONE, any_ambiguous: None, \
18121812
vector_of_enums: None, signed_enum: None, \
1813-
testrequirednestedflatbuffer: None, scalar_key_sorted_tables: None, \
1814-
native_inline: None, long_enum_non_enum_default: (empty), \
1815-
long_enum_normal_default: LongOne, nan_default: NaN, inf_default: \
1816-
inf, positive_inf_default: inf, infinity_default: inf, \
1817-
positive_infinity_default: inf, negative_inf_default: -inf, \
1818-
negative_infinity_default: -inf, double_inf_default: inf }"
1813+
testrequirednestedflatbuffer: None, scalar_key_sorted_tables: \
1814+
None, native_inline: None, long_enum_non_enum_default: \
1815+
LongEnum(0x0), long_enum_normal_default: LongEnum(LongOne), \
1816+
nan_default: NaN, inf_default: inf, positive_inf_default: inf, \
1817+
infinity_default: inf, positive_infinity_default: inf, \
1818+
negative_inf_default: -inf, negative_infinity_default: -inf, \
1819+
double_inf_default: inf }"
18191820
);
18201821
}
18211822

0 commit comments

Comments
 (0)