Skip to content
Snippets Groups Projects
Commit 6e9716f2 authored by Stephan Bosch's avatar Stephan Bosch
Browse files

Testsuite: added some control structure tests involving nesting.

parent 5a47c74b
No related branches found
No related tags found
No related merge requests found
...@@ -37,6 +37,8 @@ Next (in order of descending priority/precedence): ...@@ -37,6 +37,8 @@ Next (in order of descending priority/precedence):
* Implement environment extension * Implement environment extension
* Implement notify extension with sole support for mailto mechanism. * Implement notify extension with sole support for mailto mechanism.
* Implement date and index extensions * Implement date and index extensions
* Optimize code containing true/false tests to omit explicit JMP opcodes
(i.e. optimize the test away and any code that negatively depends on it)
* Automate script tests; i.e. build a test suite. * Automate script tests; i.e. build a test suite.
* Use lib/str-find.h for :contains and :matches match types * Use lib/str-find.h for :contains and :matches match types
* Resolve code duplication introduced for handling address-parts and match-types * Resolve code duplication introduced for handling address-parts and match-types
......
...@@ -71,6 +71,41 @@ test "ELSEIF-address-false" { ...@@ -71,6 +71,41 @@ test "ELSEIF-address-false" {
} }
} }
test "IF-nesting-static" {
if true {
if true {
if false {
test_fail "chose wrong outcome: true->true->false";
} else {
}
} else {
test_fail "chose wrong outcome: true->false";
}
} elsif true {
if false {
test_fail "chose wrong outcome: false->true->false";
} elsif true {
test_fail "chose wrong outcome: false->true->true";
}
} else {
test_fail "chose wrong outcome: false->false";
}
}
test "ALLOF-ANYOF-static" {
if allof ( true, true, true, true, anyof (false, false, true, false) ) {
if anyof( allof(false, false), allof(false, true), allof(true, false) ) {
test_fail "chose wrong outcome: true->true";
} elsif allof( anyof(false, true), true, anyof(true, false), anyof(true, true)) {
} else {
test_fail "chose wrong outcome: true->false->false";
}
} else {
test_fail "chose wrong outcome: false";
}
}
test "STOP" { test "STOP" {
stop; stop;
test_fail "continued after stop"; test_fail "continued after stop";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.