From 1600bdac60d261ce52099fc532961b0e531dcca8 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Mon, 29 Apr 2024 19:12:06 +0200 Subject: [PATCH] tools: support != in test status files PR-URL: https://github.com/nodejs/node/pull/52766 Reviewed-By: Rafael Gonzaga --- tools/test.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/test.py b/tools/test.py index 13ea6d12082bfc..e29b9f7ba05794 100755 --- a/tools/test.py +++ b/tools/test.py @@ -1041,6 +1041,9 @@ def Evaluate(self, env, defs): return self.left.Evaluate(env, defs) or self.right.Evaluate(env, defs) elif self.op == 'if': return False + elif self.op == '!=': + inter = self.left.GetOutcomes(env, defs) != self.right.GetOutcomes(env, defs) + return bool(inter) elif self.op == '==': inter = self.left.GetOutcomes(env, defs) & self.right.GetOutcomes(env, defs) return bool(inter) @@ -1128,6 +1131,9 @@ def Tokenize(self): elif self.Current(2) == '==': self.AddToken('==') self.Advance(2) + elif self.Current(2) == '!=': + self.AddToken('!=') + self.Advance(2) else: return None return self.tokens @@ -1180,7 +1186,7 @@ def ParseAtomicExpression(scan): return None -BINARIES = ['=='] +BINARIES = ['==', '!='] def ParseOperatorExpression(scan): left = ParseAtomicExpression(scan) if not left: return None