Skip to content

Commit

Permalink
Fix floating value to +0.0 explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
takasehideki committed Nov 6, 2024
1 parent 90e6201 commit b45426f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/zenohex/nif_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ defmodule Zenohex.NifTest do
describe "session" do
for {type, value} <- [
{"integer", 0},
{"float", 0.0},
{"float", +0.0},
{"binary", :erlang.term_to_binary("binary")}
] do
test "session_put_#{type}/2", %{session: session} do
Expand Down Expand Up @@ -63,7 +63,7 @@ defmodule Zenohex.NifTest do

for {type, value} <- [
{"integer", 0},
{"float", 0.0},
{"float", +0.0},
{"binary", :erlang.term_to_binary("binary")}
] do
test "publisher_put_#{type}/2", %{session: session} do
Expand Down Expand Up @@ -101,8 +101,8 @@ defmodule Zenohex.NifTest do
Nif.publisher_put_integer(publisher, 0)
assert {:ok, %Sample{value: 0}} = Nif.subscriber_recv_timeout(subscriber, 1000)

Nif.publisher_put_float(publisher, 0.0)
assert {:ok, %Sample{value: 0.0}} = Nif.subscriber_recv_timeout(subscriber, 1000)
Nif.publisher_put_float(publisher, +0.0)
assert {:ok, %Sample{value: +0.0}} = Nif.subscriber_recv_timeout(subscriber, 1000)

Nif.publisher_put_binary(publisher, "binary")
assert {:ok, %Sample{value: "binary"}} = Nif.subscriber_recv_timeout(subscriber, 1000)
Expand Down

0 comments on commit b45426f

Please sign in to comment.