Add what I thought would be a failing test case but isn't

This commit is contained in:
Dan Swain 2017-02-10 10:59:59 -05:00
parent 7582a7e7e9
commit 2d4e4ca68f

View File

@ -575,6 +575,24 @@ defmodule Thrift.Generator.BinaryProtocolTest do
} == XMan.phoenix
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
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