-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1937 from actonlang/re-enable-any-all
Re-enable any() & all()
- Loading branch information
Showing
3 changed files
with
65 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
|
||
|
||
|
||
def test_all1(): | ||
stuff = [True, True, True] | ||
if all(stuff): | ||
return | ||
raise ValueError("all stuff is True but all() returned False") | ||
|
||
def test_all2(): | ||
stuff = [True, False, True] | ||
if all(stuff): | ||
raise ValueError("not all stuff is True but all() returned True") | ||
|
||
actor main(env): | ||
try: | ||
test_all1() | ||
test_all2() | ||
env.exit(0) | ||
except Exception as e: | ||
print(e) | ||
env.exit(1) |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
|
||
|
||
|
||
def test_any1(): | ||
stuff = [True, True, True] | ||
if any(stuff): | ||
return | ||
raise ValueError("all stuff is True but any() returned False") | ||
|
||
def test_any2(): | ||
stuff = [True, False, True] | ||
if any(stuff): | ||
return | ||
raise ValueError("some stuff is True but any() returned False") | ||
|
||
def test_any3(): | ||
stuff = [False, False, False] | ||
if any(stuff): | ||
raise ValueError("no stuff is True but any() returned True") | ||
return | ||
|
||
actor main(env): | ||
try: | ||
test_any1() | ||
test_any2() | ||
test_any3() | ||
env.exit(0) | ||
except Exception as e: | ||
print(e) | ||
env.exit(1) |