Skip to content

Commit

Permalink
Add diff test for moving connections
Browse files Browse the repository at this point in the history
This is a test for ticket:4065
  • Loading branch information
sjoelund authored and OpenModelica-Hudson committed Nov 7, 2016
1 parent cca794c commit 4e7e8b6
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions openmodelica/diff/Makefile
Expand Up @@ -11,6 +11,7 @@ ChangeSourceFile.mos \
LargeFileChange.mos \
ListFile.mos \
MoveComment.mos \
MoveConnection.mos \
removeComponentModifiers.mos \
Tables.mos \
TestDiffListAPI.mos \
Expand Down
42 changes: 42 additions & 0 deletions openmodelica/diff/MoveConnection.mos
@@ -0,0 +1,42 @@
// status: correct
// From ticket:4065

echo(false);
a1 := "model test_linebreaks2_orig
Modelica.Fluid.Sources.FixedBoundary boundary(use_p=false,
use_T=false,
p=1e5) annotation(Placement(visible = true, transformation(origin = {-54, 42}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Fluid.Sources.Boundary_pT boundary1 annotation(Placement(visible = true, transformation(origin = {-58, -28}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
connect(boundary.ports[1], boundary1.ports[1]) annotation(Line(points = {{-44, 42}, {-44, 7}, {-48, 7}, {-48, -28}}, color = {0, 127, 255}));
annotation(uses(Modelica(version = \"3.2.2\")), Icon(graphics = {Polygon(origin = {-13.1502, 17.2813}, points = {{-20.8498, 26.7187}, {75.1502, 6.71867}, {15.1502, 54.7187}, {-74.8498, 22.7187}, {-42.8498, -55.2813}, {-20.8498, 26.7187}})}));
end test_linebreaks2_orig;";
b := "model test_linebreaks2_orig
Modelica.Fluid.Sources.FixedBoundary boundary(use_p = false, use_T = false, p = 1e5) annotation(Placement(visible = true, transformation(origin = {0, 62}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Fluid.Sources.Boundary_pT boundary1 annotation(Placement(visible = true, transformation(origin = {-24, -32}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
connect(boundary.ports[1], boundary1.ports[1]) annotation(Line(points = {{10, 62}, {10, 7}, {-14, 7}, {-14, -32}}, color = {0, 127, 255}));
annotation(uses(Modelica(version = \"3.2.2\")), Icon(graphics = {Polygon(origin = {-13.1502, 17.2813}, points = {{-20.8498, 26.7187}, {75.1502, 6.71867}, {15.1502, 54.7187}, {-74.8498, 22.7187}, {-42.8498, -55.2813}, {-20.8498, 26.7187}})}));
end test_linebreaks2_orig;";


echo(true);
diffModelicaFileListings(
a1,
b,
OpenModelica.Scripting.DiffFormat.color);
getErrorString();

// Result:
// true
// "model test_linebreaks2_orig
// Modelica.Fluid.Sources.FixedBoundary boundary(use_p=false,
// use_T=false,
// p=1e5) annotation(Placement(visible = true, transformation(origin = {0, 62}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
// Modelica.Fluid.Sources.Boundary_pT boundary1 annotation(Placement(visible = true, transformation(origin = {-24, -32}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
// equation
// connect(boundary.ports[1], boundary1.ports[1]) annotation(Line(points = {{10, 62}, {10, 7}, {-14, 7}, {-14, -32}}, color = {0, 127, 255}));
// annotation(uses(Modelica(version = \"3.2.2\")), Icon(graphics = {Polygon(origin = {-13.1502, 17.2813}, points = {{-20.8498, 26.7187}, {75.1502, 6.71867}, {15.1502, 54.7187}, {-74.8498, 22.7187}, {-42.8498, -55.2813}, {-20.8498, 26.7187}})}));
// end test_linebreaks2_orig;"
// ""
// endResult

0 comments on commit 4e7e8b6

Please sign in to comment.