kframework/k — pull request #394 by osa1 (2014-04-18 09:05:23+00:00)
Title: get back old ktest output mismatch error reporting (was chaged with #356)

So there was a change in ktest verbose error reporting introduced in #356 . I missed that at the time and realized yesterday.

In case of output mismatch `ktest --verbose` was reporting the error like this:

```
Running [/home/omer/K/k_new_dist/k/bin/krun /home/omer/K/k_new_dist/k/tests/examples/quine-short/test.quine --output none --color off] [output: /home/omer/K/k_new_dist/k/tests/examples/quine-short/test.quine.out]
ERROR: [/home/omer/K/k_new_dist/k/bin/krun /home/omer/K/k_new_dist/k/tests/examples/quine-short/test.quine --output none --color off] output doesn't match with expected output (time: 1672 ms)
Unexpected program output:
Expected:
module QUINE-SHORT

.List
rule
Pre:String => .
Suf:String => .
... . => ListItem(Pre +String " \"" +String replaceAll(replaceAll(replaceAll(Pre, "\\", "\\\\"), "\n", "\\n"), "\"", "\\\"") +String "\" \n" +String " \"" +String replaceAll(replaceAll(replaceAll(Suf, "\\", "\\\\"), "\n", "\\n"), "\"", "\\\"") +String "\" \n" +String Suf)
endmodule

but found:
module QUINE-SHORT

configuration
.List
"module QUINE-SHORT\n\n configuration\n .List \n"
"\n rule\n Pre:String => . \n Suf:String => . \n ... . => ListItem(Pre +String \" \\\"\" +String replaceAll(replaceAll(replaceAll(Pre, \"\\\\\", \"\\\\\\\\\"), \"\\n\", \"\\\\n\"), \"\\\"\", \"\\\\\\\"\") +String \"\\\" \\n\" +String \" \\\"\" +String replaceAll(replaceAll(replaceAll(Suf, \"\\\\\", \"\\\\\\\\\"), \"\\n\", \"\\\\n\"), \"\\\"\", \"\\\\\\\"\") +String \"\\\" \\n\" +String Suf) \nendmodule\n"

rule
Pre:String => .
Suf:String => .
... . => ListItem(Pre +String " \"" +String replaceAll(replaceAll(replaceAll(Pre, "\\", "\\\\"), "\n", "\\n"), "\"", "\\\"") +String "\" \n" +String " \"" +String replaceAll(replaceAll(replaceAll(Suf, "\\", "\\\\"), "\n", "\\n"), "\"", "\\\"") +String "\" \n" +String Suf)
endmodule
```

But after #356, it turned to this:

```
Running [/home/omer/K/k_new_dist/k/bin/krun /home/omer/K/k_new_dist/k/tests/examples/quine-short/test.quine --output none --color off] [output: /home/omer/K/k_new_dist/k/tests/examples/quine-short/test.quine.out]
ERROR: [/home/omer/K/k_new_dist/k/bin/krun /home/omer/K/k_new_dist/k/tests/examples/quine-short/test.quine --output none --color off] output doesn't match with expected output (time: 1651 ms)
Unexpected program output:
Expected:
moduleQUINE-SHORT.ListrulePre:String=>.Suf:String=>.....=>ListItemPre+String"\""+StringreplaceAllreplaceAllreplaceAllPre,"\\","\\\\","\n","\\n","\"","\\\""+String"\"\n"+String"\""+StringreplaceAllreplaceAllreplaceAllSuf,"\\","\\\\","\n","\\n","\"","\\\""+String"\"\n"+StringSufendmodule

but found:
moduleQUINE-SHORTconfiguration.List"moduleQUINE-SHORT\n\nconfiguration\n.List\n""\nrule\nPre:String=>.\nSuf:String=>.\n....=>ListItemPre+String\"\\\"\"+StringreplaceAllreplaceAllreplaceAllPre,\"\\\\\",\"\\\\\\\\\",\"\\n\",\"\\\\n\",\"\\\"\",\"\\\\\\\"\"+String\"\\\"\\n\"+String\"\\\"\"+StringreplaceAllreplaceAllreplaceAllSuf,\"\\\\\",\"\\\\\\\\\",\"\\n\",\"\\\\n\",\"\\\"\",\"\\\\\\\"\"+String\"\\\"\\n\"+StringSuf\nendmodule\n"rulePre:String=>.Suf:String=>.....=>ListItemPre+String"\""+StringreplaceAllreplaceAllreplaceAllPre,"\\","\\\\","\n","\\n","\"","\\\""+String"\"\n"+String"\""+StringreplaceAllreplaceAllreplaceAllSuf,"\\","\\\\","\n","\\n","\"","\\\""+String"\"\n"+StringSufendmodule
```

This patch gets back the old behavior.