Open Licenser opened 1 year ago
what is the exact problem
The problem is a bug in the model, the expression tested is:
let bedebcc = 1;
patch {"Bg==": bedebcc} of
merge => {"Bg==": 2}
end
which in the rest version correctly evaluates to:
{"Bg==": 2}
but in the model; evaluates to:
{"Bg==": 1}
So to clarify this is a bug in the test not a bug in the code
which technology or language is used in this bug
Mostly Erlang, @me-diru could probably give some details.
Yes, @rushi-12320. The technology used for testing is called EQC or Erlang QuickCheck. It is used here specifically to test the model aka specification of the scripting language called Script/TremorScript (Which is written in Rust but is inspired from Erlang). The one metioned in the above comment i.e
patch {"Bg==": bedebcc} of
merge => {"Bg==": 2}
end
is called patch and the documentation can be found here I am not wrong: https://www.tremor.rs/docs/0.12/language/expressions#patch
The tests here generate randomised test cases with respect to the model and check with the Rust version of the same expression to measure it's correctness and if it is working as intended.
In this bug specifically, the Rust version evaluates the expression properly and gives as the desired result
{"Bg==": 2}
But the Script/Model output is not right
{"Bg==": 1}
I highly recommend reading the following blog to understand more about this type of testing and the approach used here.
Do let us know if you have more questions!
Problem EQC model failed: