Commit 5fb6764
committed
Add cases for non-compliant struct tag
Add test cases to decode_test.go and encode_test.go that cover an
edge case described in issue #157 where a struct field uses an
incorrect tag syntax (a bare string like `bar` without the `yaml:`
prefix) alongside a correct `yaml:"foo"` tag. The new tests assert
that the library continues to accept and round-trip values when one
field uses the supported-but-nonstandard tag form.
This clarifies expected behavior and prevents regressions for legacy
struct tags that some users rely on.1 parent 779357c commit 5fb6764
2 files changed
+25
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
960 | 960 | | |
961 | 961 | | |
962 | 962 | | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
963 | 976 | | |
964 | 977 | | |
965 | 978 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
582 | 582 | | |
583 | 583 | | |
584 | 584 | | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
585 | 597 | | |
586 | 598 | | |
587 | 599 | | |
| |||
0 commit comments