Skip to content

Commit

Permalink
Add Fugit::Nat.parse() spec input len > 256 gh-104
Browse files Browse the repository at this point in the history
  • Loading branch information
jmettraux committed Aug 15, 2024
1 parent 2a11805 commit a9a2628
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions spec/nat_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,11 @@
end
end
end

it "rejects (returns nil) if input length > 256" do

expect(Fugit::Nat.parse('a' * 5000)).to be(nil)
end
end

describe '.do_parse' do
Expand Down Expand Up @@ -369,10 +374,10 @@
end
end

it "fails with an ArgumentError when the input length > 256" do
it "fails with an ArgumentError if input length > 256" do

expect { Fugit::Nat.do_parse('a' * 5000)
}.to raise_error(ArgumentError, /too long .+ 5000 > 256/)
expect { Fugit::Nat.do_parse('a' * 5000)
}.to raise_error(ArgumentError, /too long .+ 5000 > 256/)
end
end
end
Expand Down

0 comments on commit a9a2628

Please sign in to comment.