mirror of
https://github.com/valitydev/elixir-thrift.git
synced 2024-11-07 02:35:17 +00:00
Add what I thought would be a failing test case but isn't
This commit is contained in:
parent
7582a7e7e9
commit
2d4e4ca68f
@ -575,6 +575,24 @@ defmodule Thrift.Generator.BinaryProtocolTest do
|
|||||||
} == XMan.phoenix
|
} == XMan.phoenix
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@thrift_file name: "included_constants.thrift", contents: """
|
||||||
|
const i8 Z = 26
|
||||||
|
"""
|
||||||
|
|
||||||
|
@thrift_file name: "includes_constants.thrift", contents: """
|
||||||
|
include "included_constants.thrift"
|
||||||
|
|
||||||
|
struct IncludesConstants {
|
||||||
|
1: string name
|
||||||
|
2: i8 z = included_constants.Z
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
|
||||||
|
thrift_test "including a file with constants" do
|
||||||
|
assert 26 == IncludedConstants.z
|
||||||
|
assert %IncludesConstants{z: 26} == %IncludesConstants{}
|
||||||
|
end
|
||||||
|
|
||||||
thrift_test "lists serialize into maps" do
|
thrift_test "lists serialize into maps" do
|
||||||
binary = <<13, 0, 2, 3, 3, 0, 0, 0, 1, 91, 92, 0>>
|
binary = <<13, 0, 2, 3, 3, 0, 0, 0, 1, 91, 92, 0>>
|
||||||
assert binary == %Byte{val_map: %{91 => 92}} |> Byte.serialize() |> IO.iodata_to_binary
|
assert binary == %Byte{val_map: %{91 => 92}} |> Byte.serialize() |> IO.iodata_to_binary
|
||||||
|
Loading…
Reference in New Issue
Block a user