Skip to content

Commit

Permalink
Fixed (and renamed) importTransitiveBinaryModule test
Browse files Browse the repository at this point in the history
- module B should extend module A
- some renaming of authorities to make it work.
  • Loading branch information
PaulKlint committed May 18, 2024
1 parent d6bcc7f commit 0234bf6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ test bool importSimpleBinaryModule() {
return true;
}

test bool importTransitiveBinaryModule() {
test bool extendTransitiveBinaryModule() {
remove(|memory://myTestLibrary/|, recursive=true);
remove(|memory://myTestLibraryClient|, recursive=true);
remove(|memory://myTestClient|, recursive=true);
Expand Down Expand Up @@ -104,7 +104,7 @@ test bool importTransitiveBinaryModule() {
writeFile(|memory://myTestLibraryClient/src/B.rsc|,
"module B
'
'import A; // library import
'extend A; // library extension
'int bFunction() = aFunction(); // library usage
");

Expand All @@ -126,18 +126,18 @@ test bool importTransitiveBinaryModule() {
remove(|memory://myTestLibraryClient/src|, recursive=true);

// Now we compile a client
writeFile(|memory://myTestClient/src/C.rsc|,
writeFile(|memory://myTestLibraryClient/src/C.rsc|,
"module C
'
'extend B; // library import that itself depends on another library
'extend B; // library extension that itself depends on another library
'int cFunction() = bFunction() + aFunction(); // library usage from two levels of extend
");

pcfgClient = pathConfig(
srcs=[|memory://myTestClient/src|],
bin=|memory://myTestClient/bin|,
generatedSources=|memory://myTestClient/generated|,
resources=|memory://myTestClient/resources|,
srcs=[|memory://myTestLibraryClient/src|],
bin=|memory://myTestLibraryClient/bin|,
generatedSources=|memory://myTestLibraryClient/generated|,
resources=|memory://myTestLibraryClient/resources|,
libs=[|memory://myTestLibrary/resources| // library dependency on where the .tpl files are
,|memory://myTestLibraryClient/resources|] // for both projects we depend on
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
module lang::rascalcore::compile::Examples::A

data N = succ(N next) | zero();

N make(int i) {
if (i == 0) { return zero(); }
return succ(make(i - 1));
}
int aFunction() = 1;
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module lang::rascalcore::compile::Examples::B

extend lang::rascalcore::compile::Examples::A;

N succ(N next) = next; // onzinnig maar vooruit
int bFunction() = aFunction();
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module lang::rascalcore::compile::Examples::C

import lang::rascalcore::compile::Examples::B;

value main() {
return make(2); // zou zero() moeten printen en niet succ(succ(zero())
}
int cFunction() = bFunction() + aFunction();

value main() = cFunction();

0 comments on commit 0234bf6

Please sign in to comment.