Ticket #3551: removeComponentModifiers.mos

File removeComponentModifiers.mos, 788 bytes (added by Adeel Asghar, 9 years ago)
Line 
1echo(false);
2s1 := "model M1
3 A a(abc = 23) annotation(Placement(visible = true, transformation(origin={10,30}, extent = {{-30, -30}, {30, 30}}, rotation = 180)));
4end M1;";
5loadString(s1, "M1.mo");
6getErrorString();
7removeComponentModifiers(M1, "a");
8getErrorString();
9answer := "model M1
10 A a annotation(Placement(visible = true, transformation(origin={10,30}, extent = {{-30, -30}, {30, 30}}, rotation = 180)));
11end M1;";
12s2 := listFile(M1);
13print(s2);
14if answer<>diffModelicaFileListings(s1, s2, OpenModelica.Scripting.DiffFormat.plain) then
15 print("\nFailed \n");
16 print("\nStart model:\n\n" + s1 + "\n");
17 print("\nremoveComponentModifiers + listFile:\n\n" + s2 + "\n");
18 print("\nDiff:\n\n" + diffModelicaFileListings(s1, s2) + "\n");
19 print(getErrorString());
20end if;