Skip to content

Commit

Permalink
Test for multiple calls to auto_call_delayed_io
Browse files Browse the repository at this point in the history
  • Loading branch information
dmendel committed Jun 20, 2023
1 parent ac8c2e3 commit 0d3af4d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/delayed_io_test.rb
Expand Up @@ -266,3 +266,19 @@ class AutoCallDelayedIORecord < BinData::Record
_(obj.num_bytes).must_equal 2
end
end

describe BinData::DelayedIO, "with multiple auto_call" do
class MultipleAutoCallDelayedIORecord < BinData::Record
auto_call_delayed_io
auto_call_delayed_io
uint8 :a
delayed_io :b, read_abs_offset: 1 do
uint8
end
end

it "class reads" do
obj = MultipleAutoCallDelayedIORecord.read "\x01\x02"
_(obj.snapshot).must_equal({a: 1, b: 2})
end
end

0 comments on commit 0d3af4d

Please sign in to comment.