Ajout de tests (++, --)

This commit is contained in:
augustin64 2023-11-14 20:00:14 +01:00
parent 0eb84afebf
commit 7a35d457d9

View File

@ -25,5 +25,20 @@ int main() {
"Déclaration puis assignement" "Déclaration puis assignement"
); );
_TEST_ASSERT(
_TEST_NO_EXCEPTION(execute("int a = 27; ++a;") == 28),
"Incrémentation par la gauche"
);
_TEST_ASSERT(
_TEST_NO_EXCEPTION(execute("int a = 27; a--;") == 27),
"Décrémentation par la droite"
);
_TEST_ASSERT(
_TEST_NO_EXCEPTION(execute("int a = 27; -(+-++a);") == 28),
"Incrémentation et opérations unaires"
);
return 0; return 0;
} }