File tree Expand file tree Collapse file tree 3 files changed +0
-36
lines changed Expand file tree Collapse file tree 3 files changed +0
-36
lines changed Original file line number Diff line number Diff line change 180
180
"dGV%zdA==" . unpack ( "m" ) . should == [ "test" ]
181
181
end
182
182
183
- it "correctly decodes inputs longer than 2^31 / 3 characters" do
184
- ( "X" * ( 2 ** 31 / 3 + 98 ) ) . unpack ( "m" ) . first . length . should == 536870985
185
- end
186
-
187
- it "correctly decodes inputs longer than 2^32 / 3 characters" do
188
- ( "X" * ( 2 ** 32 / 3 + 99 ) ) . unpack ( "m" ) . first . length . should == 1073741898
189
- end
190
-
191
183
describe "when given count 0" do
192
184
it "decodes base64" do
193
185
"dGVzdA==" . unpack ( "m0" ) . should == [ "test" ]
196
188
it "raises an ArgumentError for an invalid base64 character" do
197
189
-> { "dGV%zdA==" . unpack ( "m0" ) } . should raise_error ( ArgumentError )
198
190
end
199
-
200
- it "correctly decodes inputs longer than 2^31 / 3 characters" do
201
- ( "X" * ( 2 ** 31 / 3 + 98 ) ) . unpack ( "m0" ) . first . length . should == 536870985
202
- end
203
-
204
- it "correctly decodes inputs longer than 2^32 / 3 characters" do
205
- ( "X" * ( 2 ** 32 / 3 + 99 ) ) . unpack ( "m0" ) . first . length . should == 1073741898
206
- end
207
191
end
208
192
end
Original file line number Diff line number Diff line change 94
94
[ "%O<.^P[\\ `\n " , [ "\xbd \xc3 \xbe \xc3 \xbf " ] ]
95
95
] . should be_computed_by ( :unpack , "u" )
96
96
end
97
-
98
- it "correctly decodes inputs longer than 2^31 / 3 characters" do
99
- line = "M" + ( "X" * 60 ) + "\n "
100
- count = ( 2 **31 / 3 ) / line . length + 1
101
- ( line * count ) . unpack ( "u" ) . first . length . should == 45 * count
102
- end
103
-
104
- it "correctly decodes inputs longer than 2^32 / 3 characters" do
105
- line = "M" + ( "X" * 60 ) + "\n "
106
- count = ( 2 **32 / 3 ) / line . length + 1
107
- ( line * count ) . unpack ( "u" ) . first . length . should == 45 * count
108
- end
109
97
end
Original file line number Diff line number Diff line change 43
43
it "raises an ArgumentError for an invalid base64 character" do
44
44
-> { "dGV%zdA==" . unpack1 ( "m0" ) } . should raise_error ( ArgumentError )
45
45
end
46
-
47
- it "correctly decodes inputs longer than 2^31 / 3 characters" do
48
- ( "X" * ( 2 ** 31 / 3 + 98 ) ) . unpack1 ( "m0" ) . length . should == 536870985
49
- end
50
-
51
- it "correctly decodes inputs longer than 2^32 / 3 characters" do
52
- ( "X" * ( 2 ** 32 / 3 + 99 ) ) . unpack1 ( "m0" ) . length . should == 1073741898
53
- end
54
46
end
55
47
end
You can’t perform that action at this time.
0 commit comments