add parser tests for use of 'else' after bad conditionals
Change-Id: I9885f629a2f6511574eebd81896a1d9f258e55cb Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
This commit is contained in:
parent
79de60f38b
commit
a3fac53864
@ -1373,6 +1373,29 @@ void tst_qmakelib::proParser_data()
|
|||||||
<< "in:1: Unexpected 'else'."
|
<< "in:1: Unexpected 'else'."
|
||||||
<< false;
|
<< false;
|
||||||
|
|
||||||
|
QTest::newRow("double-test-else")
|
||||||
|
<< "foo bar\nelse"
|
||||||
|
<< TS(
|
||||||
|
/* 0 */ << H(TokBranch)
|
||||||
|
/* 1 */ /* then branch */ << I(0)
|
||||||
|
/* 3 */ /* else branch */ << I(1) // This seems weird
|
||||||
|
/* 5 */ << H(TokTerminator))
|
||||||
|
<< "in:1: Extra characters after test expression."
|
||||||
|
<< false;
|
||||||
|
|
||||||
|
QTest::newRow("test-function-else")
|
||||||
|
<< "foo bar()\nelse"
|
||||||
|
<< TS(
|
||||||
|
/* 0 */ << H(TokLine) << H(1)
|
||||||
|
/* 2 */ << H(TokTestCall) // This seems pointless
|
||||||
|
/* 3 */ << H(TokFuncTerminator)
|
||||||
|
/* 4 */ << H(TokBranch)
|
||||||
|
/* 5 */ /* then branch */ << I(0)
|
||||||
|
/* 7 */ /* else branch */ << I(1) // This seems weird
|
||||||
|
/* 9 */ << H(TokTerminator))
|
||||||
|
<< "in:1: Extra characters after test expression."
|
||||||
|
<< false;
|
||||||
|
|
||||||
// Braces
|
// Braces
|
||||||
|
|
||||||
QTest::newRow("{}")
|
QTest::newRow("{}")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user