1 | echo(false);
|
---|
2 | s1 := "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;
|
---|
12 | end A;";
|
---|
13 | loadString(s1, "A.mo");
|
---|
14 | getErrorString();
|
---|
15 | addComponent(z, Real, A.P1.M);
|
---|
16 | getErrorString();
|
---|
17 | answer := "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;
|
---|
28 | end A;";
|
---|
29 | s2 := listFile(A);
|
---|
30 | //print(s2);
|
---|
31 | res := diffModelicaFileListings(s1, s2, OpenModelica.Scripting.DiffFormat.plain);
|
---|
32 | //print("\n"+res);
|
---|
33 | if answer<>res then
|
---|
34 | print("\nFailed:\nGot:\n"+diffModelicaFileListings(s1, s2, OpenModelica.Scripting.DiffFormat.plain)+"\nExpected:\n"+diffModelicaFileListings(s1, s2, OpenModelica.Scripting.DiffFormat.color));
|
---|
35 | end if;
|
---|