mirror of https://github.com/tailix/libkernaux.git
Ruby: add more tests
This commit is contained in:
parent
b9a3c92b8c
commit
ab5cc91434
|
@ -61,6 +61,12 @@ RSpec.describe KernAux, '.cmdline' do
|
|||
end
|
||||
end
|
||||
|
||||
context 'when there are not too many args' do
|
||||
let(:str) { 'a ' * 256 }
|
||||
|
||||
specify { expect(cmdline).to eq ['a'] * 256 }
|
||||
end
|
||||
|
||||
context 'when there are too many args' do
|
||||
let(:str) { 'a ' * 257 }
|
||||
|
||||
|
@ -70,6 +76,12 @@ RSpec.describe KernAux, '.cmdline' do
|
|||
end
|
||||
end
|
||||
|
||||
context 'when args don\'t cause buffer overflow' do
|
||||
let(:str) { 'a' * 4095 }
|
||||
|
||||
specify { expect(cmdline).to eq ['a' * 4095] }
|
||||
end
|
||||
|
||||
context 'when args cause buffer overflow' do
|
||||
let(:str) { 'a' * 4096 }
|
||||
|
||||
|
|
Loading…
Reference in New Issue