Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@
<dependency>
<groupId>io.usethesource</groupId>
<artifactId>vallang</artifactId>
<version>1.0.1-RC1</version>
<version>1.1.0-RC1</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
15 changes: 9 additions & 6 deletions src/org/rascalmpl/library/lang/rascal/tests/basic/Locations.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,14 @@ str createValidScheme(str s) {
@expected{MalFormedURI}
test bool noOpaqueURI2() = loc _ := |home:://this:is:opaque|;

test bool canChangeScheme1(loc l, str s) = (l[scheme = createValidScheme(s)]).scheme == createValidScheme(s);
test bool canChangeScheme2(loc l, str s) { l.scheme = createValidScheme(s); return l.scheme == createValidScheme(s); }
str lowerCaseHost(/(?s)^<user:[^@]+>@<host:.*>$/) = "<user>@<toLowerCase(host)>";
default str lowerCaseHost(str auth) = toLowerCase(auth);

test bool canChangeAuthority1(loc l, str s) = (l[authority = s]).authority == s;
test bool canChangeAuthority2(loc l, str s) { l.authority = s; return l.authority == s; }
test bool canChangeScheme1(loc l, str s) = (l[scheme = createValidScheme(s)]).scheme == toLowerCase(createValidScheme(s));
test bool canChangeScheme2(loc l, str s) { l.scheme = createValidScheme(s); return l.scheme == toLowerCase(createValidScheme(s)); }

test bool canChangeAuthority1(loc l, str s) = (l[authority = s]).authority == lowerCaseHost(s);
test bool canChangeAuthority2(loc l, str s) { l.authority = s; return l.authority == lowerCaseHost(s); }

str fixPath(str s) = visit (s) { case /\/\/+/ => "/" };

Expand All @@ -53,8 +56,8 @@ str createValidHost(str s) {
return ("a.a" | it + stringChar(validHostChars[c % size(validHostChars)]) | c <- chars(s)) + "a.com";
}

test bool canChangeHost1(loc l, str s) = (l[scheme="http"][authority="a"][host = createValidHost(s)]).host == createValidHost(s);
test bool canChangeHost2(loc l, str s) { l.scheme="http"; l.authority = "a"; l.host = createValidHost(s); return l.host == createValidHost(s); }
test bool canChangeHost1(loc l, str s) = (l[scheme="http"][authority="a"][host = createValidHost(s)]).host == toLowerCase(createValidHost(s));
test bool canChangeHost2(loc l, str s) { l.scheme="http"; l.authority = "a"; l.host = createValidHost(s); return l.host == toLowerCase(createValidHost(s)); }

test bool canChangeUser1(loc l, str s) = contains(s, "@") || (l[scheme="http"][authority="a@a.com"][user = s]).user == s;
test bool canChangeUser2(loc l, str s) { if (contains(s, "@")) return true; l.scheme="http"; l.authority = "a@a.com"; l.user = s; if ( l.user == s) { return true; } else {println("<l.user> != <s>"); return false; } }
Expand Down
2 changes: 1 addition & 1 deletion src/org/rascalmpl/uri/file/SystemPathURIResolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class SystemPathURIResolver implements ILogicalSourceLocationResolver {

@Override
public String scheme() {
return "PATH";
return "path";
}


Expand Down
Loading