Skip to content

Commit

Permalink
Remove ugly tee hack
Browse files Browse the repository at this point in the history
  • Loading branch information
Keno committed Jan 9, 2013
1 parent 5e63bba commit 9bdae3f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions base/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/errno_h.jl
/build_h.jl
/file_constants.jl
/uv_constants.jl
6 changes: 3 additions & 3 deletions test/gzip.jl
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,9 @@ unicode_gz_file = "$tmp/unicode_test.gz"
UTF32BE_path = joinpath(tmp,"UTF32BE.unicode")
UTF32LE_path = joinpath(tmp,"UTF32LE.unicode")
UTF8_path = joinpath(tmp,"UTF8.unicode")
run(`perl -e 'print pack "N*", 0xfeff, 0..0xd7ff, 0xe000..0x10ffff' ` | `tee $UTF32BE_path` > SpawnNullStream() )
run(`iconv -f UTF-32BE -t UTF-32LE $UTF32BE_path` | `tee $UTF32LE_path` > SpawnNullStream())
run(`iconv -f UTF-32BE -t UTF-8 $UTF32BE_path` | `tee $UTF8_path` > SpawnNullStream())
run(`perl -e 'print pack "N*", 0xfeff, 0..0xd7ff, 0xe000..0x10ffff' ` > UTF32BE_path)
run(`iconv -f UTF-32BE -t UTF-32LE $UTF32BE_path` | UTF32LE_path)
run(`iconv -f UTF-32BE -t UTF-8 $UTF32BE_path` | UTF8_path)

str1 = CharString(reinterpret(Char, read(open(UTF32LE_path), Uint32, 1112065)[2:]));
str2 = UTF8String(read(open(UTF8_path), Uint8, 4382595)[4:]);
Expand Down
4 changes: 2 additions & 2 deletions test/unicode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ unicodedir = mktempdir()
# Use perl to generate the primary data
primary_encoding = "UTF-32BE"
primary_path = joinpath(unicodedir, primary_encoding*".unicode")
run(`perl -e 'print pack "N*", 0xfeff, 0..0xd7ff, 0xe000..0x10ffff' ` | `tee $primary_path` > SpawnNullStream() )
run(`perl -e 'print pack "N*", 0xfeff, 0..0xd7ff, 0xe000..0x10ffff' ` | primary_path )

# Use iconv to generate the other data
for encoding in ["UTF-32LE", "UTF-16BE", "UTF-16LE", "UTF-8"]
output_path = joinpath(unicodedir, encoding*".unicode")
run(`iconv -f $primary_encoding -t $encoding $primary_path` | `tee $output_path` > SpawnNullStream())
run(`iconv -f $primary_encoding -t $encoding $primary_path` | output_path)
end

str1 = CharString(reinterpret(Char, read(open(joinpath(unicodedir,"UTF-32LE.unicode")), Uint32, 1112065)[2:]))
Expand Down

0 comments on commit 9bdae3f

Please sign in to comment.