@@ -287,26 +287,15 @@ baz
287287}
288288
289289Describe " Get-Content -Raw test" - Tags " CI" {
290- BeforeAll {
291- $lfTextUnterminated = " a`n b"
292- $lfText = " a`n b`n "
293- $crlfTextUnterminated = " a`r`n b"
294- $crlfText = " a`r`n b`r`n "
295- Set-Content - Encoding Ascii - NoNewline " $TestDrive \lf.txt" - value $lfText
296- Set-Content - Encoding Ascii - NoNewline " $TestDrive \crlf.txt" - value $crlfText
297- Set-Content - Encoding Ascii - NoNewline " $TestDrive \lf-nt.txt" - value $lfTextUnterminated
298- Set-Content - Encoding Ascii - NoNewline " $TestDrive \crlf-nt.txt" - value $crlfTextUnterminated
299- }
300- It " Reads LF-terminated files in full." {
301- Get-Content - Raw " $TestDrive \lf.txt" | Should BeExactly $lfText
302- }
303- It " Reads CRLF-terminated files in full." {
304- Get-Content - Raw " $TestDrive \crlf.txt" | Should BeExactly $crlfText
305- }
306- It " Reads LF-separated files without trailing newline in full." {
307- Get-Content - Raw " $TestDrive \lf-nt.txt" | Should BeExactly $lfTextUnterminated
308- }
309- It " Reads CRLF-separated files without trailing newline in full." {
310- Get-Content - Raw " $TestDrive \crlf-nt.txt" | Should BeExactly $crlfTextUnterminated
290+
291+ It " Reads - <testname> in full" - TestCases @ (
292+ @ {character = " a`n b`n " ; testname = " LF-terminated files" ; filename = " lf.txt" }
293+ @ {character = " a`r`n b`r`n " ; testname = " CRLF-terminated files" ; filename = " crlf.txt" }
294+ @ {character = " a`n b" ; testname = " LF-separated files without trailing newline" ; filename = " lf-nt.txt" }
295+ @ {character = " a`r`n b" ; testname = " CRLF-separated files without trailing newline" ; filename = " crlf-nt.txt" }
296+ ) {
297+ param ($character , $filename )
298+ Set-Content - Encoding Ascii - NoNewline " $TestDrive \$filename " - value $character
299+ Get-Content - Raw " $TestDrive \$filename " | Should BeExactly $character
311300 }
312301}
0 commit comments