Ticket #5410: 5410.mos

File 5410.mos, 866 bytes (added by Adeel Asghar, 6 years ago)
Line 
1echo(false);
2s1 := "package A
3 package P1
4 model M
5 Real x(
6 start = 0,
7 fixed = true)
8 \"variable comment\";
9 Real yy = 12;
10 end M;
11 end P1;
12end A;";
13loadString(s1, "A.mo");
14getErrorString();
15addComponent(z, Real, A.P1.M);
16getErrorString();
17answer := "package A
18 package P1
19 model M
20 Real x(
21 start = 0,
22 fixed = true)
23 \"variable comment\";
24 Real yy = 12;
25 Real z;
26 end M;
27 end P1;
28end A;";
29s2 := listFile(A);
30//print(s2);
31res := diffModelicaFileListings(s1, s2, OpenModelica.Scripting.DiffFormat.plain);
32//print("\n"+res);
33if answer<>res then
34 print("\nFailed:\nGot:\n"+diffModelicaFileListings(s1, s2, OpenModelica.Scripting.DiffFormat.plain)+"\nExpected:\n"+diffModelicaFileListings(s1, s2, OpenModelica.Scripting.DiffFormat.color));
35end if;