Python: Add data-flow tests for BoolExp

> 6.11. Boolean operations

> The expression x and y first evaluates x; if x is false, its value is
> returned; otherwise, y is evaluated and the resulting value is
> returned.

> The expression x or y first evaluates x; if x is true, its value is
> returned; otherwise, y is evaluated and the resulting value is
> returned.
This commit is contained in:
Rasmus Wriedt Larsen
2021-10-08 18:20:14 +02:00
parent 2539e3247a
commit 15476c2513

View File

@@ -422,6 +422,18 @@ def test_call_extra_keyword_flow():
SINK(f_extra_keyword_flow(**{SOURCE: None})) #$ MISSING:flow="SOURCE -> f_extra_keyword(..)"
# 6.11. Boolean operations
def test_or(x = False):
# if we don't know the value of the lhs, we should always add flow
SINK(x or SOURCE) #$ MISSING: flow="SOURCE -> BoolExp"
def test_and(x = True):
# if we don't know the value of the lhs, we should always add flow
SINK(x and SOURCE) #$ MISSING: flow="SOURCE -> BoolExp"
# 6.12. Assignment expressions
def test_assignment_expression():
x = NONSOURCE