You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm new to Lux, but I have been "playing" with it for a while. Now I have a doubt about how to read some files (e.g. a .txt file) and "expect" some content. What I am doing at the moment is:
I do not understand exactly how you want to compare those two files. Is your use case as simple as using the unix diff utility and checking that there are no diffs between files?
I do not know of any such built in functionality (binding files to variables) that you ask for.
Usually, you want your test to specify exactly what to expect in each step of your test. For example, making sure that some lines exist in a file. Loading two files and doing some comparison breaks this as the lux test result will vary depending on which files you compare.
Perhaps you want to write some bash/python script that you give your files to, and that outputs some results? Then the lux script could expect something in those results and the comparison logic will be lifted out of lux.
If you output a file so that lux will handle it, for instance by calling 'cat' or 'echo' from a lux script, then I see no reason as to why '?+' would not work. Did you find a case where it does not work?
Hi @hawk !
I'm new to Lux, but I have been "playing" with it for a while. Now I have a doubt about how to read some files (e.g. a .txt file) and "expect" some content. What I am doing at the moment is:
.lux file:
And when I execute the lux command I do the following:
config4=$(cat config4.txt) golden4=$(cat golden4.txt) lux test4.lux
That way I am able to compare the content of that 2 files. But, is there a built in system to do that? or this is a "good" way?
Related to these question is another one. Am I able to use ?+ (undeterministic match) with the content loaded from a file?
Hope to hear you soon!
Thank you very much!
Jose
The text was updated successfully, but these errors were encountered: