Skip to content

Instantly share code, notes, and snippets.

@donaldh
Created August 26, 2013 11:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save donaldh/b66e23a436daed71cdcd to your computer and use it in GitHub Desktop.
Save donaldh/b66e23a436daed71cdcd to your computer and use it in GitHub Desktop.
I guess there are encoding differences that I cannot 'see'.
% make t/spec/S32-io/slurp.t
t/spec/S32-io/slurp.rakudo.jvm ..
1..16
ok 1 - slurp() on non-existent files fails
ok 2 - slurp() on directories fails
ok 3 - test file slurp with path call ok
ok 4 - slurp returns a string
not ok 5 - slurp with path loads entire file
# got: '0123456789
# ABCDEFG
# 風, 薔薇, バズ
# '
# expected: '0123456789
# ABCDEFG
# 風, 薔薇, バズ
# '
ok 6 - empty files yield empty string
not ok 7 - method form .slurp works
# got: '0123456789
# ABCDEFG
# 風, 薔薇, バズ
# '
# expected: '0123456789
# ABCDEFG
# 風, 薔薇, バズ
# '
not ok 8 - function passed a filehandle works
# got: '0123456789
# ABCDEFG
# 風, 薔薇, バズ
# '
# expected: '0123456789
# ABCDEFG
# 風, 薔薇, バズ
# '
not ok 9 - slurp with no parameters loads $*ARGFILES
# got: '0123456789
# ABCDEFG
# 風, 薔薇, バズ
# '
# expected: '0123456789
# ABCDEFG
# 風, 薔薇, バズ
# '
ok 10 - # SKIP IO::Handle.read NYI on this backend
ok 11 - # SKIP IO::Handle.read NYI on this backend
ok 12 - # SKIP IO::Handle.read NYI on this backend
ok 13 - slurp :enc - encoding functions
not ok 14 - utf8 looks normal
# got: '0123456789
# ABCDEFG
# 風, 薔薇, バズ
# '
# expected: '0123456789
# ABCDEFG
# 風, 薔薇, バズ
# '
not ok 15 - iso-8859-1 makes mojibake correctly
# got: '0123456789
# ABCDEFG
# 風, 薔薇, バズ
# '
# expected: '0123456789
# ABCDEFG
# 風, 薔薇, バズ
# '
not ok 16 - lines() - exactly 3 lines in this file
# got: '4'
# expected: '3'
# FUDGED!
# Looks like you failed 7 tests of 16
Failed 7/16 subtests
(less 3 skipped subtests: 6 okay)
Test Summary Report
-------------------
t/spec/S32-io/slurp.rakudo.jvm (Wstat: 0 Tests: 16 Failed: 7)
Failed tests: 5, 7-9, 14-16
Files=1, Tests=16, 20 wallclock secs ( 0.03 usr 0.01 sys + 0.04 cusr 0.01 csys = 0.09 CPU)
Result: FAIL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment