Skip to content

Commit e97f909

Browse files
skinandboneszookzook
authored andcommitted
add encode test for %BSON.Binary{subtype: :binary_old}
1 parent c124df3 commit e97f909

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/bson_test.exs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ defmodule BSONTest do
7272
@map20 %{"p" => :BSON_max}
7373
@bin20 <<8, 0, 0, 0, 127, 112, 0, 0>>
7474

75+
@map21 %{"q" => %BSON.Binary{binary: <<1,2,3>>, subtype: :binary_old}}
76+
@bin21 <<20, 0, 0, 0, 5, 113, 0, 7, 0, 0, 0, 2, 3, 0, 0, 0, 1, 2, 3, 0>>
77+
7578
test "encode" do
7679
assert encode(@map1) == @bin1
7780
assert encode(@map2) == @bin2
@@ -93,6 +96,7 @@ defmodule BSONTest do
9396
assert encode(@map18) == @bin18
9497
assert encode(@map19) == @bin19
9598
assert encode(@map20) == @bin20
99+
assert encode(@map21) == @bin21
96100
end
97101

98102
test "decode" do
@@ -116,6 +120,7 @@ defmodule BSONTest do
116120
assert decode(@bin18) == @map18
117121
assert decode(@bin19) == @map19
118122
assert decode(@bin20) == @map20
123+
assert decode(@bin21) == @map21
119124
end
120125

121126
test "keywords" do

0 commit comments

Comments
 (0)