Files
n8n-openai-adapter/lib/elixir/test/elixir/bitwise_test.exs
T
Andrea Leopardi d04a404466 Improve test names in a few modules
I mostly used the

    test "foo/x" do
      # ...
    end

convention instead of using "foo" as the test title. In some cases I added some
descriptive string to make the test more self-explanatory.
2016-12-08 20:27:02 +01:00

63 lines
930 B
Elixir

Code.require_file "test_helper.exs", __DIR__
defmodule Bitwise.FunctionsTest do
use ExUnit.Case, async: true
doctest Bitwise, import: true
use Bitwise, skip_operators: true
test "bnot/1" do
assert bnot(1) == -2
end
test "band/2" do
assert band(1, 1) == 1
end
test "bor/2" do
assert bor(0, 1) == 1
end
test "bxor/2" do
assert bxor(1, 1) == 0
end
test "bsl/2" do
assert bsl(1, 1) == 2
end
test "bsr/2" do
assert bsr(1, 1) == 0
end
end
defmodule Bitwise.OperatorsTest do
use ExUnit.Case, async: true
use Bitwise, only_operators: true
test "bnot (~~~)" do
assert ~~~1 == -2
end
test "band (&&&)" do
assert (1 &&& 1) == 1
end
test "bor (|||)" do
assert (0 ||| 1) == 1
end
test "bxor (^^^)" do
assert 1 ^^^ 1 == 0
end
test "bsl (<<<)" do
assert (1 <<< 1) == 2
end
test "bsr (>>>)" do
assert (1 >>> 1) == 0
end
end