1 | echo(false);
|
---|
2 | s1 := "model M1
|
---|
3 | annotation(Icon(coordinateSystem(
|
---|
4 | preserveAspectRatio=false,
|
---|
5 | extent={{-100,-100},{100,100}}), graphics={
|
---|
6 | Line(points={{-60,50},{60,50}}, color={0,0,255}),
|
---|
7 | Line(points={{-40,30},{40,30}}, color={0,0,255}),
|
---|
8 | Line(points={{-20,10},{20,10}}, color={0,0,255}),
|
---|
9 | Line(points={{0,90},{0,50}}, color={0,0,255})}));
|
---|
10 | end M1;";
|
---|
11 | loadString(s1, "M1.mo");
|
---|
12 | getErrorString();
|
---|
13 | addComponent(m1, Real, M1, annotate=Placement(visible=true, transformation=transformation(origin={-24,-54}, extent={{-10,-10},{10,10}}, rotation=0)));
|
---|
14 | getErrorString();
|
---|
15 | answer := "model M1
|
---|
16 | Real m1 annotation(Placement(visible = true, transformation(origin = {-32, -28}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
|
---|
17 | annotation(Icon(coordinateSystem(
|
---|
18 | preserveAspectRatio=false,
|
---|
19 | extent={{-100,-100},{100,100}}), graphics={
|
---|
20 | Line(points={{-60,50},{60,50}}, color={0,0,255}),
|
---|
21 | Line(points={{-40,30},{40,30}}, color={0,0,255}),
|
---|
22 | Line(points={{-20,10},{20,10}}, color={0,0,255}),
|
---|
23 | Line(points={{0,90},{0,50}}, color={0,0,255})}));
|
---|
24 | end M1;";
|
---|
25 | s2 := listFile(M1);
|
---|
26 | print(s2);
|
---|
27 | if answer<>diffModelicaFileListings(s1, s2, OpenModelica.Scripting.DiffFormat.plain) then
|
---|
28 | print("\nFailed \n");
|
---|
29 | print("\nStart model:\n\n" + s1 + "\n");
|
---|
30 | print("\nAdded component+listFile:\n\n" + s2 + "\n");
|
---|
31 | print("\nDiff:\n\n" + diffModelicaFileListings(s1, s2) + "\n");
|
---|
32 | print(getErrorString());
|
---|
33 | end if;
|
---|