diff --git a/pkgs/ruby/spec/lib/kernaux/cmdline_spec.rb b/pkgs/ruby/spec/lib/kernaux/cmdline_spec.rb index f95b266..c2a51cf 100644 --- a/pkgs/ruby/spec/lib/kernaux/cmdline_spec.rb +++ b/pkgs/ruby/spec/lib/kernaux/cmdline_spec.rb @@ -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 }