Skip to content

Commit

Permalink
fix: correct names of generated enum for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ahamez committed Nov 26, 2024
1 parent 3effd4e commit 0cbd6e8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions test/protox/parse_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ defmodule Protox.ParseTest do
end

test "Parse FileDescriptorSet, protobuf 3 enums", %{enums: enums} do
{_, constants} = Enum.find(enums, fn {name, _} -> name == Abc.Def.ForeignEnum end)
{_, constants} = Enum.find(enums, fn {name, _} -> name == Abc.Def.MyForeignEnum end)
assert constants == [{0, :FOREIGN_ZERO}, {1, :FOREIGN_ONE}, {1, :FOREIGN_ONE_BIS}]

{_, constants} = Enum.find(enums, fn {name, _} -> name == Abc.Def.Proto3.NestedEnum end)
Expand All @@ -26,7 +26,8 @@ defmodule Protox.ParseTest do
assert field(fs, 5) == {:optional, :oneof_1_double, {:oneof, :oneof_1}, :double}

assert field(fs, 6) ==
{:optional, :oneof_1_foreign_enum, {:oneof, :oneof_1}, {:enum, Abc.Def.ForeignEnum}}
{:optional, :oneof_1_foreign_enum, {:oneof, :oneof_1},
{:enum, Abc.Def.MyForeignEnum}}

assert field(fs, 7) == {:optional, :oneof_1_proto2a, {:oneof, :oneof_1}, {:message, Proto2A}}

Expand Down
2 changes: 1 addition & 1 deletion test/samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ to generate `file_descriptor_set.bin`. This file is used by the Protox.Parse
test. The following command is used to generate this file:

```
protoc --include_imports -o ./file_descriptor_set.bin ./*.proto
protoc --include_imports -o ./file_descriptor_set.bin ./proto2_extension.proto ./proto2.proto ./proto3.proto
```
Binary file modified test/samples/file_descriptor_set.bin
Binary file not shown.

0 comments on commit 0cbd6e8

Please sign in to comment.