Here fxField is a SpecificFixed and fxField.bytes returns an array of byte, byte[]. There no setScale method.
This class LogicalSc is commented as generated code, and is stored in avrohugger-core/src/test/expected. This not in the scala classpath. Therefore the build does not attempt to compile it.
The test SpecificFileToFileSpec.e24 generates its own LogicalSc and then asserts that it is the same as example. This passes, but neither source is compiled.
How to demonstrate this problem
git clone https://github.com/julianpeeters/avrohugger.git
cd avrohugger
mkdir -p avrohugger-core/src/test/scala/example
cp -r avrohugger-core/src/test/expected/specific/example/logical avrohugger-core/src/test/scala/example/.
sbt test
Error in sbt output
[error] 22 | val scaledValue = fxField.bytes.setScale(scale)
[error] | ^^^^^^^^^^^^^^^^^^^^^^
[error] | value setScale is not a member of Array[Byte]
[warn] one warning found
[error] one error found
[error] (avrohugger-core / Test / compileIncremental) Compilation failed
The test could be updated to assert that it asserts that the generated code compiles.
Hi,
There are 2 issues.
I have investigated the test. Here are my findings
The example class LogicalSc has an error at line 22
val scaledValue = fxField.bytes.setScale(scale)
Here
fxField
is aSpecificFixed
andfxField.bytes
returns an array of byte,byte[]
. There no setScale method.This class LogicalSc is commented as generated code, and is stored in
avrohugger-core/src/test/expected
. This not in the scala classpath. Therefore the build does not attempt to compile it.The test SpecificFileToFileSpec.e24 generates its own LogicalSc and then asserts that it is the same as example. This passes, but neither source is compiled.
How to demonstrate this problem
Error in sbt output
The test could be updated to assert that it asserts that the generated code compiles.