Update function
Update function #1000
I implemented the Update function but I don't now how to write Update.txt , I don't know how test.txt work can some body explain it for me
@microsoft-github-policy-service agree
Thanks for your PR!
Regarding the txt file test, please create a new Update.txt file at ...src\tests\Microsoft.PowerFx.Core.Tests\ExpressionTestCases.
The syntax should be
>> POWER-FX_EXPRESSION_1
EXPECTED_RESULT_1
>> POWER-FX_EXPRESSION_2
EXPECTED_RESULT_2
.
.
.
>> POWER-FX_EXPRESSION_N
EXPECTED_RESULT_N
The test framework should catch the file automatically and run the expressions in it.
Thanks @anderson-joyle
Patch(t1, r1, {Field2:"mars"}); t1 Table({Field1:1,Field2:"mars",Field3:DateTime(2022,1,1,0,0,0,0),Field4:true})
How does this work?
@pooya1380m - thanks for the contribution. I'm curious - are you using Power Fx libraries for something?
At the top of Patch.txt file we have MutationFunctionsTestSetup setup. You can check its implementation here:
https://github.com/microsoft/Power-Fx/blob/c37f0963973b1ad80e829f0c8bb80567bfcb805d/src/tests/Microsoft.PowerFx.Interpreter.Tests/PowerFxEvaluationTests.cs#L146C13-L146C13
This setup creates a table variable t1 populated with some records in advance. We can then reference t1 within the txt test file.
Please also check txt files at ...src\tests\Microsoft.PowerFx.Interpreter.Tests\MutationScripts. The big difference is that here the result from an expression persists to the next one.
@pooya1380m - thanks for the contribution. I'm curious - are you using Power Fx libraries for something? No I'm interested in the concept of Power Fx and would like to contribute to it
Hi @anderson-joyle I want to know if I used the correct black value for my tests ? and Im doing it in right way?