File tree Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,13 @@ require "./spec_helper"
22require " ./fixture/*"
33
44describe BinaryParser do
5+ describe " #uint64" do
6+ it " parse correct" do
7+ parser = UInt64Parser .new.load(UInt64Fixture )
8+ expect(parser.value).to eq(42 )
9+ end
10+ end
11+
512 describe " #uint32" do
613 it " parse correct" do
714 parser = UInt32Parser .new.load(UInt32Fixture )
@@ -23,6 +30,13 @@ describe BinaryParser do
2330 end
2431 end
2532
33+ describe " #int64" do
34+ it " parse correct" do
35+ parser = Int64Parser .new.load(Int64Fixture )
36+ expect(parser.value).to eq(42 )
37+ end
38+ end
39+
2640 describe " #int32" do
2741 it " parse correct" do
2842 parser = Int32Parser .new.load(Int32Fixture )
Original file line number Diff line number Diff line change 1+ require " ../../src/binary_parser"
2+
3+ class Int64Parser < BinaryParser
4+ int64 :value
5+ end
6+
7+ Int64Fixture = IO ::Memory .new(sizeof(Int64 ))
8+ Int64Fixture .write_bytes(42 i64 )
9+ Int64Fixture .rewind
Original file line number Diff line number Diff line change 1+ require " ../../src/binary_parser"
2+
3+ class UInt64Parser < BinaryParser
4+ uint64 :value
5+ end
6+
7+ UInt64Fixture = IO ::Memory .new(sizeof(UInt64 ))
8+ UInt64Fixture .write_bytes(42 u64 )
9+ UInt64Fixture .rewind
You can’t perform that action at this time.
0 commit comments