Skip to content

Commit

Permalink
Add testcase for ticket:4153
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoelund authored and OpenModelica-Hudson committed Nov 28, 2016
1 parent 7bf5664 commit 640b434
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 5 deletions.
3 changes: 2 additions & 1 deletion openmodelica/diff/Makefile
Expand Up @@ -16,9 +16,10 @@ MoveConnection.mos \
removeComponentModifiers.mos \
Tables.mos \
TestDiffListAPI.mos \
Ticket3619.mos \
ticket3619.mos \
ticket3642.mos \
Ticket4110.mos \
ticket4153.mos
UTF8.mos

# test that currently fail. Move up when fixed.
Expand Down
File renamed without changes.
File renamed without changes.
@@ -1,17 +1,17 @@
// status: correct
// depends: Ticket3619.mo
// depends: Ticket3619.expected
// depends: ticket3619.mo
// depends: ticket3619.expected

echo(false);
s1 := readFile("Ticket3619.mo");
s1 := readFile("ticket3619.mo");

loadString(s1);

deleteClass(withFolder.OLD);

s2 := list();

answer := readFile("Ticket3619.expected");
answer := readFile("ticket3619.expected");

res := diffModelicaFileListings(s1, s2, OpenModelica.Scripting.DiffFormat.plain);
if answer<>res then
Expand Down
21 changes: 21 additions & 0 deletions openmodelica/diff/ticket4153.mos
@@ -0,0 +1,21 @@
// status: correct
// Fixes the illegal multiple annotations and merges them into one
// Does not manage to keep formatting in a good way

diffModelicaFileListings(
"block Microcontroller\nannotation(defaultComponentName = \"mcu\",\nmissingInnerMessage = \"Missing inner block for AVR microcontroller (this\ncannot have default values since the microcontrollers are all\ndifferent).\");\n annotation(Icon(graphics = {Text(origin = {32, -3},\nlineColor = {255, 255, 255}, extent = {{-44, 19}, {-20, -13}}, textString\n= \"AVR\", fontSize = 70, fontName = \"Arial\", textStyle =\n{TextStyle.Bold})}, coordinateSystem(initialScale = 0.1)));\nend\nMicrocontroller;",

"block Microcontroller\n annotation(Icon(graphics = {Text(origin = {32, 9}, lineColor = {255, 255, 255}, extent = {{-44, 19}, {-20, -13}}, textString = \"AVR\", fontSize = 70, fontName = \"Arial\", textStyle = {TextStyle.Bold})}, coordinateSystem(initialScale = 0.1)), defaultComponentName = \"mcu\", missingInnerMessage = \"Missing inner block for AVR microcontroller (this\ncannot have default values since the microcontrollers are all\ndifferent).\");\nend Microcontroller;",
OpenModelica.Scripting.DiffFormat.plain);
getErrorString();

// Result:
// "block Microcontroller
//
// annotation(Icon(graphics = {Text(origin = {32, 9}, lineColor = {255, 255, 255}, extent = {{-44, 19}, {-20, -13}}, textString = \"AVR\", fontSize = 70, fontName = \"Arial\", textStyle = {TextStyle.Bold})}, coordinateSystem(initialScale = 0.1)), defaultComponentName = \"mcu\", missingInnerMessage = \"Missing inner block for AVR microcontroller (this
// cannot have default values since the microcontrollers are all
// different).\");
// end
// Microcontroller;"
// ""
// endResult

0 comments on commit 640b434

Please sign in to comment.