Skip to content

Commit

Permalink
Capture some more sample programs from issue chapel-lang#11262
Browse files Browse the repository at this point in the history
Bryant pointed out that the behavior of these tests has varied
over the past few releases/months which motivated me to capture
them to make sure further variation doesn't happen unexpectedly
(I believe the current behavior is correct, or at least, as
currently intended).
  • Loading branch information
bradcray committed Sep 6, 2019
1 parent 632eb2a commit 8f115d5
Show file tree
Hide file tree
Showing 10 changed files with 82 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/modules/use/topLevel/subVsTop.chpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module M {
module N {
proc fn() { writeln("M"); }
}
}

module N {
proc fn() { writeln("g"); }
}

{
use N only;
use M;
N.fn();
}
1 change: 1 addition & 0 deletions test/modules/use/topLevel/subVsTop.good
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
M
15 changes: 15 additions & 0 deletions test/modules/use/topLevel/subVsTop1a.chpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module M {
module N {
proc fn() { writeln("M"); }
}
}

module N {
proc fn() { writeln("g"); }
}

{
use M;
use N only;
N.fn();
}
1 change: 1 addition & 0 deletions test/modules/use/topLevel/subVsTop1a.good
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
M
15 changes: 15 additions & 0 deletions test/modules/use/topLevel/subVsTop2.chpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module M {
module N {
var x = 100;
}
}

module N {
var x = 42;
}

{
use N only;
use M;
writeln(N.x);
}
1 change: 1 addition & 0 deletions test/modules/use/topLevel/subVsTop2.good
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
100
15 changes: 15 additions & 0 deletions test/modules/use/topLevel/subVsTop2a.chpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module M {
module N {
var x = 100;
}
}

module N {
var x = 42;
}

{
use M;
use N only;
writeln(N.x);
}
1 change: 1 addition & 0 deletions test/modules/use/topLevel/subVsTop2a.good
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
100
16 changes: 16 additions & 0 deletions test/modules/use/topLevel/subVsTop3.chpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module M {
module N {
var x = 100;
}
}

module N {
var x = 42;
}

{
use M only N as N2;
use N only;
writeln(N.x);
writeln(N2.x);
}
2 changes: 2 additions & 0 deletions test/modules/use/topLevel/subVsTop3.good
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
42
100

0 comments on commit 8f115d5

Please sign in to comment.