mirror of
https://github.com/higherkindness/mu-haskell.git
synced 2024-10-05 19:37:54 +03:00
1d8319ef98
Closes #297 In protobuf, unions themselves are optional, so while parsing if any value fails to parse, its default must not be considered. When the default is considered and first value in the union is not specified, the union still gets parsed as the default of the first value. So, in this instance: oneof foo { int32 foo_int = 1; string foo_str = 2; } foo_str will never be parsed, as foo_int will have a default, i.e. 0 and so foo_str "blah" will always wrongly parse as foo_int 0. Co-authored-by: Akshay Mankar <itsakshaymankar@gmail.com>
20 lines
778 B
Bash
Executable File
20 lines
778 B
Bash
Executable File
#!/bin/sh
|
||
echo "BUILDING"
|
||
stack build mu-avro mu-protobuf
|
||
mkdir -p dist
|
||
|
||
echo "\nAVRO\n====\n"
|
||
echo "python/generate"
|
||
python3 adapter/avro/test/avro/generate.py adapter/avro/test/avro/example.avsc dist/avro-python.avro
|
||
stack test-avro dist/avro-haskell.avro dist/avro-python.avro
|
||
echo "ptyhon/consume"
|
||
python3 adapter/avro/test/avro/consume.py adapter/avro/test/avro/example.avsc dist/avro-haskell.avro
|
||
|
||
# if protobuf is not installed, do so with 'pip install protobuf'
|
||
echo "\nPROTOBUF\n========\n"
|
||
echo "python/generate"
|
||
python2 adapter/protobuf/test/protobuf/generate.py dist/protobuf-python.pbuf
|
||
stack exec test-protobuf dist/protobuf-haskell.pbuf dist/protobuf-python.pbuf
|
||
echo "python/consume"
|
||
python2 adapter/protobuf/test/protobuf/consume.py dist/protobuf-haskell.pbuf
|