Correctly handle missing/null values with ~<> operator.

(That's case-insensitive non-equal.)

Fixes https://github.com/wixtoolset/issues/issues/5372
This commit is contained in:
Bob Arnson 2021-03-07 19:28:18 -05:00
Родитель 7f128f4639
Коммит 838d10a319
2 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -896,7 +896,7 @@ static HRESULT CompareOperands(
else
{
// not a combination that can be compared
*pfResult = (BURN_SYMBOL_TYPE_NE == comparison);
*pfResult = (BURN_SYMBOL_TYPE_NE == comparison || BURN_SYMBOL_TYPE_NE_I == comparison);
}
LExit:

Просмотреть файл

@ -258,7 +258,10 @@ namespace Bootstrapper
Assert::True(EvaluateConditionHelper(&variables, L"PROP1 = \"VAL1\""));
Assert::False(EvaluateConditionHelper(&variables, L"NONE = \"NOT\""));
Assert::False(EvaluateConditionHelper(&variables, L"PROP1 <> \"VAL1\""));
Assert::False(EvaluateConditionHelper(&variables, L"PROP1 ~<> \"VAL1\""));
Assert::False(EvaluateConditionHelper(&variables, L"PROP1 ~<> \"Val1\""));
Assert::True(EvaluateConditionHelper(&variables, L"NONE <> \"NOT\""));
Assert::True(EvaluateConditionHelper(&variables, L"NONE ~<> \"NOT\""));
Assert::True(EvaluateConditionHelper(&variables, L"PROP1 ~= \"val1\""));
Assert::False(EvaluateConditionHelper(&variables, L"PROP1 = \"val1\""));