From 7a35d457d97ded03948bb050b11ced6176bf57ab Mon Sep 17 00:00:00 2001 From: augustin64 <me.git@augustin64.fr> Date: Tue, 14 Nov 2023 20:00:14 +0100 Subject: [PATCH] Ajout de tests (++, --) --- test/variables.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/variables.cpp b/test/variables.cpp index cbf7be2..6ca7ceb 100644 --- a/test/variables.cpp +++ b/test/variables.cpp @@ -25,5 +25,20 @@ int main() { "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; } \ No newline at end of file