diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-06-09 13:32:02 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-07-03 10:22:45 +0200 |
commit | 58a5dfe2c5d47a02406bec4cc0df9595efabd5ff (patch) | |
tree | 8917b6f8a16fd1c00744b0502939962aac2aab4c /rtemsqual/tests/test_content_c.py | |
parent | content: Add CContent.call_function() (diff) | |
download | rtems-central-58a5dfe2c5d47a02406bec4cc0df9595efabd5ff.tar.bz2 |
content: Add condition methods to CContent
Diffstat (limited to 'rtemsqual/tests/test_content_c.py')
-rw-r--r-- | rtemsqual/tests/test_content_c.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/rtemsqual/tests/test_content_c.py b/rtemsqual/tests/test_content_c.py index 756a215d..e3cd6148 100644 --- a/rtemsqual/tests/test_content_c.py +++ b/rtemsqual/tests/test_content_c.py @@ -306,3 +306,28 @@ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb( void ); c } """ + + +def test_condition(): + content = CContent() + with content.condition("a"): + content.add("b") + assert str(content) == """if ( a ) { + b +} +""" + content = CContent() + with content.first_condition("a"): + content.add("b") + with content.next_condition("c"): + content.add("d") + with content.final_condition(None): + content.add("e") + assert str(content) == """if ( a ) { + b +} else if ( c ) { + d +} else { + e +} +""" |