You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ones I found were tilde, tab, and newline by themselves, or newline within a string.
I'm unclear on the correct fix, so I don't have a PR for you, but here's a test set:
[Theory][MemberData(nameof(BuggedString_TestCases))]publicvoidSome_strings_fail_to_roundtrip_as_a_dictionary_key_or_value(stringval){varobj=newDictionary<string,string>{{ val, val },};varresult=DoRoundtripFromObjectTo<Dictionary<string,string>>(obj);
result.Should().Equal(obj);// The failing strings need quoting and don't get them.}publicstaticIEnumerable<Object[]>BuggedString_TestCases{// All these values correctly round-trip as simple strings.
get
{// These values fail to round-trip correctly as key or value in a dictionary.yieldreturnnew Object[]{"~"};yieldreturnnew Object[]{"\n"};yieldreturnnew Object[]{"\t"};yieldreturnnew Object[]{"x\nx"};// These values round-trip correctly despite similarity to failing cases.yieldreturnnew Object[]{"x~x"};yieldreturnnew Object[]{"x\tx"};yieldreturnnew Object[]{" ~ "};yieldreturnnew Object[]{"\n"};yieldreturnnew Object[]{"\t"};}}
The text was updated successfully, but these errors were encountered:
The ones I found were tilde, tab, and newline by themselves, or newline within a string.
I'm unclear on the correct fix, so I don't have a PR for you, but here's a test set:
The text was updated successfully, but these errors were encountered: