# Each click of Run button below starts with a completely fresh setup of directories, files, etc.
run 'echo', 'first run'; run 'perl6', 'main-path1.pl6'; # Run prog shown in 2nd tab
run 'echo', 'cp libs to path2'; run 'cp', '-r', '-p', 'path1', 'path2'; # Copy .precomp dir as well
run 'echo', 'run using path2'; run 'perl6', 'main-path2.pl6'; # Run prog shown in 3rd tab
run 'echo', 'edit path2/lib1'; spurt 'path2/lib1.pm6', 'unit module lib1; use lib2; our $value = $lib2::value;';
run 'echo', 'edit path2/lib2'; spurt 'path2/lib2.pm6', 'unit module lib2; our $value = 2;';
run 'echo', 'run path2 again'; run 'perl6', 'main-path2.pl6';
# As is, running this yields `1`, `1`, and `2` -- as expected.
# But commenting out 'edit lib1' line yields `1`, `1`, `1` -- the "edit" of lib2 has no effect.
# The 'edit lib1' line spurts exactly the same as the existing lib1 content.
run 'echo', 'main-path1';
use lib 'path1';
use lib1;
run 'echo', $lib1::value;
run 'echo', 'main-path2';
use lib 'path2';
use lib1;
run 'echo', $lib1::value;
unit module lib1; use lib2; our $value = $lib2::value;
unit module lib2; our $value = 1;