Diff command outputs against text file
Instead of diffing two text files against each other, I am attempting to diff the output of a command against a text file. The following excerpt from a robot file does not seem to work:
Diff Files <(cat foo.txt) bar.txt
The output of this robot file excerpt is:
test | FAIL | <(cat foo.txt) doesn't exist
Should this usage work out of the box, or is it necessary to add this functionality?
Thank you!
@petercelentano i would suggest like this
Diff two files with content as the second file is different
${filename} = Generate Random String 8 [LOWER]
${content} = Get File ${datadir}/loremipsum.txt
Create File ${TEMPDIR}/${filename}.txt ${content}
Run Keyword And Expect Error *differences* Diff Files ${TEMPDIR}/${filename}.txt ${datadir}/${/}loremipsum3.txt
@petercelentano any updates?
@vkosuri This was the solution I came up with:
Run Process ls - la /home/user > /opt/test/ls-la.test.txt shell=True
Diff Files /opt/test/ls-la.test.txt /opt/expected/ls-la.txt
I'm first running the command I want to diff and sending stout to a file. Then I'm running the diff of that file against an expected output.
I would prefer to diff without having to create a file from the command output first though.
@petercelentano are looking something like this feature? You could try with pull #7
@petercelentano any updates?
What is the syntax for using this feature? Is it any different than what is posted above?