Browse Source

Add pretty tests for UTF-8 string literal edge cases

Only two plain ASCII u8 literals were covered; the empty literal and
a literal made of escape sequences pin the recovery heuristic
boundaries.

Assisted-by: Claude:claude-fable-5:Claude Code
pull/3857/head
Siegfried Pammer 3 days ago committed by Siegfried Pammer
parent
commit
169c399f78
  1. 2
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/InitializerTests.cs

2
ICSharpCode.Decompiler.Tests/TestCases/Pretty/InitializerTests.cs

@ -458,6 +458,8 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests @@ -458,6 +458,8 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty.InitializerTests
#if CS110 && !NET40
public static ReadOnlySpan<byte> UTF8Literal => "Hello, world!"u8;
public static ReadOnlySpan<byte> UTF8LiteralWithNullTerminator => "Hello, world!\0"u8;
public static ReadOnlySpan<byte> UTF8LiteralEmpty => ""u8;
public static ReadOnlySpan<byte> UTF8LiteralWithEscapeSequences => "line1\nline2\t\"quoted\"\\"u8;
#endif
#endregion

Loading…
Cancel
Save