Ruby: add more tests

This commit is contained in:
Alex Kotov 2022-01-23 05:22:54 +05:00
parent b9a3c92b8c
commit ab5cc91434
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
1 changed files with 12 additions and 0 deletions

View File

@ -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 }