Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
30bca45e
Commit
30bca45e
authored
Nov 15, 2016
by
Damien George
Browse files
tests/basics: Add test for logical constant folding.
parent
9b525134
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/basics/logic_constfolding.py
0 → 100644
View file @
30bca45e
# tests logical constant folding in parser
def
f_true
():
print
(
'f_true'
)
return
True
def
f_false
():
print
(
'f_false'
)
return
False
print
(
0
or
False
)
print
(
1
or
foo
)
print
(
f_false
()
or
1
or
foo
)
print
(
f_false
()
or
1
or
f_true
())
print
(
0
and
foo
)
print
(
1
and
True
)
print
(
f_true
()
and
0
and
foo
)
print
(
f_true
()
and
1
and
f_false
())
print
(
not
0
)
print
(
not
False
)
print
(
not
1
)
print
(
not
True
)
print
(
not
not
0
)
print
(
not
not
1
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment