From 59c6de121841ab9623fbeb658570e9d5d0e0ace5 Mon Sep 17 00:00:00 2001 From: Stanislav Gromov Date: Sat, 30 Jan 2021 21:20:33 +0700 Subject: [PATCH] Update tests --- source/compiler/tests/warning_250_251.pwn | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/compiler/tests/warning_250_251.pwn b/source/compiler/tests/warning_250_251.pwn index 1083e3f..4eb83fb 100644 --- a/source/compiler/tests/warning_250_251.pwn +++ b/source/compiler/tests/warning_250_251.pwn @@ -85,8 +85,11 @@ main() while(fread(f,line,sizeof(line),false) < m) {} // shouldn't warn about "f" or "m" not being modified fclose(f); - // Case 12: Warnings 250 and 251 don't work for global variables (yet?) - while (glbvar < 10) {} - for (glbvar = 0; glbvar < 10; ) {} + // Case 12: Warnings 250 and 251 shouldn't trigger when at least one global + // variable is used inside the loop condition, as globals can be modified + // from a function called from the loop body and currently there's no easy + // way to track this. + while (n < glbvar) {} + for (new i = 0; i < glbvar; ) {} }