File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -379,21 +379,18 @@ date: !!timestamp 2001-12-14
379379 }
380380
381381 It ' decodes percent escapes in expanded tags using UTF-8' {
382- $yaml = @'
383- %TAG !e! tag:example.com,2000:app/
384- ---
385- first: !e!tag%21 value
386- second: !e!currency%E2%82%AC amount
387- '@
388- $representation = Read-YamlStreamCore - Yaml $yaml - Depth 32 - MaxNodes 64 - MaxAliases 16 `
389- - MaxScalarLength 4096 - MaxTagLength 1024 - MaxTotalTagLength 4096 `
390- - MaxNumericLength 64
391-
392- $representation.Value.Count | Should - Be 1
393- $entries = $representation.Value [0 ].Entries
394- $entries.Count | Should - Be 2
395- $entries [0 ].Value.Tag | Should - Be ' tag:example.com,2000:app/tag!'
396- $entries [1 ].Value.Tag | Should - Be (' tag:example.com,2000:app/currency' + [char ] 0x20AC )
382+ $escaped = Get-TestYamlRepresentationRoot - Yaml (
383+ " %TAG !e! tag:example.com,2000:app/`n --- !e!tag%21 value"
384+ )
385+ $multibyte = Get-TestYamlRepresentationRoot - Yaml (
386+ " %TAG !e! tag:example.com,2000:app/`n --- !e!currency%E2%82%AC amount"
387+ )
388+
389+ $escaped.Tag | Should - Be ' tag:example.com,2000:app/tag!'
390+ $escaped.HasUnknownTag | Should - BeTrue
391+ $multibyte.Tag |
392+ Should - Be (' tag:example.com,2000:app/currency' + [char ] 0x20AC )
393+ $multibyte.HasUnknownTag | Should - BeTrue
397394 }
398395
399396 It ' rejects malformed or non-UTF8 tag percent escapes' {
You can’t perform that action at this time.
0 commit comments