-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[t/spec/] "Junction" -> "junction", ".eigenstates" -> "!eigenstates" …
…(as per r25891). [t/TODO] Now we need to ensure that the tests can call junction!eigenstates. git-svn-id: http://svn.pugscode.org/pugs@28971 c213334d-75ef-0310-aa23-eaa082d1ae64
- Loading branch information
Kodi
authored and
Kodi
committed
Nov 1, 2009
1 parent
a586cc3
commit ffa7511
Showing
10 changed files
with
88 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,35 @@ | ||
use v6; | ||
use Test; | ||
plan 13; | ||
plan 14; | ||
|
||
# L<S32::Containers/junction/!eigenstates> | ||
|
||
dies_ok { (1|2).eigenstates }, 'junction doesn't have a public .eigenstates'; | ||
|
||
sub je(Object $j) { | ||
return $j.eigenstates.sort.join('|'); | ||
return $j!eigenstates.sort.join('|'); | ||
} | ||
|
||
is je(any(1, 3, 2)), '1|2|3', '.eigenstates on any-junction (sub form)'; | ||
is je(3|1|2), '1|2|3', '.eigenstates on any-junction (operator form)'; | ||
is je(any(1, 3, 2)), '1|2|3', '!eigenstates on any-junction (sub form)'; | ||
is je(3|1|2), '1|2|3', '!eigenstates on any-junction (operator form)'; | ||
|
||
is je(all(1, 3, 2)), '1|2|3', '.eigenstates on all-junction (sub form)'; | ||
is je(3&1&2), '1|2|3', '.eigenstates on all-junction (operator form)'; | ||
is je(all(1, 3, 2)), '1|2|3', '!eigenstates on all-junction (sub form)'; | ||
is je(3&1&2), '1|2|3', '!eigenstates on all-junction (operator form)'; | ||
|
||
is je(one(1, 3, 2)), '1|2|3', '.eigenstates on one-junction (sub form)'; | ||
is je(3^1^2), '1|2|3', '.eigenstates on one-junction (operator form)'; | ||
is je(one(1, 3, 2)), '1|2|3', '!eigenstates on one-junction (sub form)'; | ||
is je(3^1^2), '1|2|3', '!eigenstates on one-junction (operator form)'; | ||
|
||
is je(none(1, 3, 2)), '1|2|3', '.eigenstates on none-junction'; | ||
is je(none(1, 3, 2)), '1|2|3', '!eigenstates on none-junction'; | ||
|
||
#?rakudo 2 skip '.eigenstates on nested junctions' | ||
is +(1|(2|3)).eigenstates, 3, 'Nested junctions are flattened (count)'; | ||
#?rakudo 2 skip '!eigenstates on nested junctions' | ||
is +(1|(2|3))!eigenstates, 3, 'Nested junctions are flattened (count)'; | ||
is je(1|(2|3)), '1|2|3', 'Nested junctions are flattened (result)'; | ||
|
||
# .eigenstates on any non-junction just gives a list of the thing itself | ||
is 42.eigenstates.elems, 1, 'eigenstates on value is list of one item'; | ||
is 42.eigenstates[0], 42, 'eigenstates on value is list containing the thingy'; | ||
# !eigenstates on any non-junction just gives a list of the thing itself | ||
is 42!eigenstates.elems, 1, 'eigenstates on value is list of one item'; | ||
is 42!eigenstates[0], 42, 'eigenstates on value is list containing the thingy'; | ||
my $x = "pivo"; | ||
is $x.eigenstates.elems, 1, 'eigenstates on non-Junction variable is list of one item'; | ||
is $x.eigenstates[0], 'pivo', 'eigenstates on non-Junction variable is list containing the thingy'; | ||
is $x!eigenstates.elems, 1, 'eigenstates on non-Junction variable is list of one item'; | ||
is $x!eigenstates[0], 'pivo', 'eigenstates on non-Junction variable is list containing the thingy'; | ||
|
||
# vim: ft=perl6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters