Exemplo n.º 1
0
 public static void Ctor_CreateFromRelaxed_Utf8()
 {
     Assert.Same(Utf8String.Empty, Utf8String.CreateFromRelaxed(ReadOnlySpan <byte> .Empty));
     Assert.Equal(u8("xy\uFFFDz"), Utf8String.CreateFromRelaxed(new byte[] { (byte)'x', (byte)'y', 0xF4, 0x80, 0x80, (byte)'z' }));
 }
Exemplo n.º 2
0
 public static void Ctor_CreateFromRelaxed_Utf16()
 {
     Assert.Same(Utf8String.Empty, Utf8String.CreateFromRelaxed(ReadOnlySpan <char> .Empty));
     Assert.Equal(u8("xy\uFFFDz"), Utf8String.CreateFromRelaxed("xy\ud800z".AsSpan()));
 }