diff --git a/YamlDotNet.Test/Core/ScannerTests.cs b/YamlDotNet.Test/Core/ScannerTests.cs index 6ef9c159..eb3cd93a 100644 --- a/YamlDotNet.Test/Core/ScannerTests.cs +++ b/YamlDotNet.Test/Core/ScannerTests.cs @@ -1,4 +1,4 @@ -// This file is part of YamlDotNet - A .NET library for YAML. +// This file is part of YamlDotNet - A .NET library for YAML. // Copyright (c) Antoine Aubry and contributors // // Permission is hereby granted, free of charge, to any person obtaining a copy of @@ -544,6 +544,20 @@ public void Utf16StringsAsUtf8SurrogatesWorkCorrectly() StreamEnd); } + [Fact] + public void Utf16CharactersAreReadCorrectly() + { + AssertSequenceOfTokensFrom(Yaml.ScannerForText("Test: \"\uD83D\uDC4D\""), + StreamStart, + BlockMappingStart, + Key, + PlainScalar("Test"), + Value, + DoubleQuotedScalar("\uD83D\uDC4D"), // guaranteed thumbs up emoticon that will work in Windows Terminal since it pukes on displaying it. + BlockEnd, + StreamEnd); + } + private void AssertPartialSequenceOfTokensFrom(Scanner scanner, params Token[] tokens) { var tokenNumber = 1;