Skip to content

Commit

Permalink
Add test for listFile+setSourceFile
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoelund committed Aug 12, 2015
1 parent 0a5dcc7 commit d8f3d68
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
36 changes: 36 additions & 0 deletions openmodelica/diff/ChangeSourceFile.mos
@@ -0,0 +1,36 @@
// status: correct
// Checks that elements that are not classes are part of the listed file
// even if their source file is different

s := "within ;model M1
Real a;
Real b;
Real c;
M m1;
end M1;";
loadString(s, "M1", "UTF-8");
getErrorString();
setSourceFile(M1, "MX");
getErrorString();
diffModelicaFileListings(s, listFile(M1), OpenModelica.Scripting.DiffFormat.plain);
getErrorString();

// Result:
// "within ;model M1
// Real a;
// Real b;
// Real c;
// M m1;
// end M1;"
// true
// ""
// true
// ""
// "model M1
// Real a;
// Real b;
// Real c;
// M m1;
// end M1;"
// ""
// endResult
1 change: 1 addition & 0 deletions openmodelica/diff/Makefile
Expand Up @@ -3,6 +3,7 @@ TEST = ../../rtest

TESTFILES = \
AddComponent.mos \
ChangeSourceFile.mos \
TestDiffListAPI.mos

# test that currently fail. Move up when fixed.
Expand Down

0 comments on commit d8f3d68

Please sign in to comment.