test all freaky array cases
This commit is contained in:
parent
fa47088a78
commit
ff166b5ab5
1 changed files with 28 additions and 1 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/local/bin/ruby
|
#!/usr/local/bin/ruby
|
||||||
|
|
||||||
# $Dwarf: uu_test.rb,v 1.1 2003/04/20 16:33:02 ward Exp $
|
# $Dwarf: yenc_test.rb,v 1.1 2003/04/20 18:32:39 ward Exp $
|
||||||
# $Source$
|
# $Source$
|
||||||
|
|
||||||
require '../yenc.rb'
|
require '../yenc.rb'
|
||||||
|
|
@ -32,6 +32,7 @@ def test2
|
||||||
reference = file.readlines
|
reference = file.readlines
|
||||||
file.close
|
file.close
|
||||||
|
|
||||||
|
print " with dos linebreaks\n"
|
||||||
mode, filename, body = YEnc.ydecode(lines)
|
mode, filename, body = YEnc.ydecode(lines)
|
||||||
|
|
||||||
if filename != "testdata"
|
if filename != "testdata"
|
||||||
|
|
@ -41,6 +42,32 @@ def test2
|
||||||
else
|
else
|
||||||
print "Succesful\n"
|
print "Succesful\n"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
lines.collect!{|x| x.chomp("\r\n")}
|
||||||
|
print " without linebreaks\n"
|
||||||
|
mode, filename, body = YEnc.ydecode(lines)
|
||||||
|
|
||||||
|
if filename != "testdata"
|
||||||
|
print "Failed, filename should be \"testdata\", but is \"#{filename}\"\n"
|
||||||
|
elsif reference != body
|
||||||
|
print "Failed, result doesn't match reference data\n"
|
||||||
|
else
|
||||||
|
print "Succesful\n"
|
||||||
|
end
|
||||||
|
|
||||||
|
lines.collect!{|x| x.sub(/$/, "\n")}
|
||||||
|
print " with unix linebreaks\n"
|
||||||
|
mode, filename, body = YEnc.ydecode(lines)
|
||||||
|
|
||||||
|
if filename != "testdata"
|
||||||
|
print "Failed, filename should be \"testdata\", but is \"#{filename}\"\n"
|
||||||
|
elsif reference != body
|
||||||
|
print "Failed, result doesn't match reference data\n"
|
||||||
|
else
|
||||||
|
print "Succesful\n"
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def test3
|
def test3
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue