Skip to content

Commit ab49715

Browse files
Auto-quote strings
1 parent c2b7c51 commit ab49715

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

exercises/practice/acronym/.meta/Generator.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public class AcronymTests
66
[Fact{{#unless @first}}(Skip = "Remove this Skip property to run this test"){{/unless}}]
77
public void {{method_name path}}()
88
{
9-
Assert.Equal("{{expected}}", Acronym.Abbreviate("{{input.phrase}}"));
9+
Assert.Equal({{expected}}, Acronym.Abbreviate({{input.phrase}}));
1010
}
1111
{{/test_cases}}
1212
}

exercises/practice/isogram/.meta/Generator.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public class IsogramTests
66
[Fact{{#unless @first}}(Skip = "Remove this Skip property to run this test"){{/unless}}]
77
public void {{method_name path}}()
88
{
9-
Assert.{{expected}}(Isogram.IsIsogram("{{input.phrase}}"));
9+
Assert.{{expected}}(Isogram.IsIsogram({{input.phrase}}));
1010
}
1111
{{/test_cases}}
1212
}

generators.new/TemplateRenderer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ public void Format<T>(T value, in EncodedTextWriter writer)
4747
if (value is not JsonElement element)
4848
throw new ArgumentException("Invalid type");
4949

50-
writer.Write(SymbolDisplay.FormatLiteral(element.ToString(), false));
50+
writer.WriteSafeString(SymbolDisplay.FormatLiteral(element.ToString(), element.ValueKind == JsonValueKind.String));
5151
}
5252

5353
public bool TryCreateFormatter(Type type, out IFormatter formatter)
5454
{
5555
if (type != typeof(JsonElement))
5656
{
57-
formatter = null;
57+
formatter = null!;
5858
return false;
5959
}
6060

0 commit comments

Comments
 (0)