Skip to content

Commit

Permalink
removed testdata:/// and the need for it
Browse files Browse the repository at this point in the history
  • Loading branch information
jurgenvinju committed Sep 14, 2023
1 parent faa93cf commit cd3ee7f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 19 deletions.
2 changes: 1 addition & 1 deletion META-INF/RASCAL.MF
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Project-Name: rascal
Source: src/org/rascalmpl/library,test/org/rascalmpl/benchmark
Source: src/org/rascalmpl/library,test/org/rascalmpl/benchmark,/org/rascalmpl/test/data
Courses: src/org/rascalmpl/courses


Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public void contributePaths(List<ISourceLocation> l) {

try {
l.add(vf.sourceLocation("std","",""));
l.add(vf.sourceLocation("testdata","",""));
l.add(vf.sourceLocation("test-modules","",""));
}
catch (URISyntaxException e) {
Expand All @@ -75,7 +74,7 @@ public void contributePaths(List<ISourceLocation> l) {

@Override
public String toString() {
return "[std://, testdata://, test-modules://]";
return "[std:///, test-modules:///]";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import String;
import lang::java::m3::Core;
import lang::java::m3::AST;

private loc get(str path) = {l} := findResources(path) ? l : |not-found:///| + path;

@javaClass{org.rascalmpl.library.lang.rascal.tests.library.lang.java.m3.SnakesAndLadders}
public java loc getSnakesAndLaddersPath();

Expand Down Expand Up @@ -70,7 +72,7 @@ private M3 buildM3(loc projectName, loc root, list[loc] classPath, list[loc] sou
= composeJavaM3(projectName, createM3sFromFiles(find(root, "java"),sourcePath = sourcePath, classPath = classPath, javaVersion ="1.7"));


// unpackExampleProject("snakes-and-ladders", |testdata:///m3/snakes-and-ladders-project-source.zip|);
// unpackExampleProject("snakes-and-ladders", get("m3/snakes-and-ladders-project-source.zip"));

private bool compareM3s(loc reference, str projectName, loc sourceZip, M3 (loc) builder)
= compareM3s(
Expand All @@ -80,11 +82,11 @@ private bool compareM3s(loc reference, str projectName, loc sourceZip, M3 (loc)

@ignoreCompiler{M3 not yet supported}
public test bool junitM3RemainedTheSame()
= compareM3s(|testdata:///m3/junit4-m3s.bin|, "junit4", |testdata:///m3/junit4-project-source.zip|, getJunitM3);
= compareM3s(get("m3/junit4-m3s.bin"), "junit4", get("m3/junit4-project-source.zip"), getJunitM3);

@ignoreCompiler{M3 not yet supported}
public test bool snakesM3RemainedTheSame()
= compareM3s(|testdata:///m3/snakes-and-ladders-m3s.bin|, "snakes-and-ladders", |testdata:///m3/snakes-and-ladders-project-source.zip|, getSnakesM3);
= compareM3s(get("m3/snakes-and-ladders-m3s.bin"), "snakes-and-ladders", get("m3/snakes-and-ladders-project-source.zip"), getSnakesM3);


private bool compareASTs(loc reference, str projectName, loc sourceZip, set[Declaration] (loc) builder)
Expand All @@ -95,11 +97,11 @@ private bool compareASTs(loc reference, str projectName, loc sourceZip, set[Decl

@ignoreCompiler{M3 not yet supported}
public test bool junitASTsRemainedTheSame()
= compareASTs(|testdata:///m3/junit4-asts.bin|, "junit4", |testdata:///m3/junit4-project-source.zip|, getJunitASTs);
= compareASTs(get("m3/junit4-asts.bin"), "junit4", get("m3/junit4-project-source.zip"), getJunitASTs);

@ignoreCompiler{M3 not yet supported}
public test bool snakesASTsRemainedTheSame()
= compareASTs(|testdata:///m3/snakes-and-ladders-asts.bin|, "snakes-and-ladders", |testdata:///m3/snakes-and-ladders-project-source.zip|, getSnakesASTs);
= compareASTs(get("m3/snakes-and-ladders-asts.bin"), "snakes-and-ladders", get("m3/snakes-and-ladders-project-source.zip"), getSnakesASTs);


private bool compareASTs(set[Declaration] a, set[Declaration] b) = a == b;
Expand All @@ -121,7 +123,7 @@ private bool compareJarM3s(loc reference, loc jar, M3 (loc) builder)
);

public test bool hamcrestJarM3RemainedTheSame()
= compareJarM3s(|testdata:///m3/hamcrest-library-1.3-m3.bin|, |testdata:///m3/hamcrest-library-1.3.jar|, getHamcrestM3);
= compareJarM3s(get("m3/hamcrest-library-1.3-m3.bin"), get("m3/hamcrest-library-1.3.jar"), getHamcrestM3);

// TODO: think if this can be replaced by the generic diff function.
public bool compareM3s(M3 a, M3 b) {
Expand Down
9 changes: 0 additions & 9 deletions src/org/rascalmpl/uri/libraries/TestDataURIResolver.java

This file was deleted.

1 change: 0 additions & 1 deletion src/org/rascalmpl/uri/resolvers.config
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ org.rascalmpl.uri.zip.ZipURIResolver
org.rascalmpl.uri.file.HomeURIResolver
org.rascalmpl.uri.file.CWDURIResolver
org.rascalmpl.uri.file.SystemPathURIResolver
org.rascalmpl.uri.libraries.TestDataURIResolver
org.rascalmpl.uri.libraries.MemoryResolver
org.rascalmpl.uri.libraries.RascalLibraryURIResolver
org.rascalmpl.shell.ManifestURIResolver

0 comments on commit cd3ee7f

Please sign in to comment.