-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e3ddab6
commit e61eb13
Showing
2 changed files
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
defmodule Petal.BitfieldTest do | ||
use ExUnit.Case | ||
|
||
alias Petal.Bitfield | ||
|
||
describe "new/1" do | ||
test "returns a new bitfield of size `x`" do | ||
bitfield = Bitfield.new(64) | ||
assert bitfield.size == 64 | ||
assert bitfield.bitfield == <<0, 0, 0, 0, 0, 0, 0, 0>> | ||
end | ||
end | ||
|
||
test "to_string/1" do | ||
bitfield = Bitfield.new(8) | ||
assert to_string(bitfield) =~ ~r/Field data: 00000000/ | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
defmodule Petal.BytesTest do | ||
use ExUnit.Case | ||
doctest Petal.Bytes | ||
|
||
alias Petal.Bytes | ||
|
||
|