Skip to content

Commit 2f5be73

Browse files
committed
Updated documentation about fileextensions and unit tests.
(cherry picked from commit 799eb71)
1 parent f806e09 commit 2f5be73

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

UserManual.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,9 @@ For example, the following set a menu visible only when the user right-click on
296296

297297
The `fileextensions` attribute validates a menu based on the file's extension selected by the user.
298298

299-
If `fileextensions` attribute is specified, the file's extension selected by the user must match for the validation to be successful. To specify multiple extension, one must separate each extensions with the `;` character. If multiple file extensions are specified, **at least one** extension must match for the validation to be successful.
299+
If `fileextensions` attribute is specified, the file's extension selected by the user must match for the validation to be successful. To specify multiple file extension, one must separate each extensions with the `;` character. If multiple file extensions are specified, **at least one** extension must match for the validation to be successful.
300+
301+
If multiple files are selected, the file extension of each element must match **at least one** allowed file extension for the validation to be successful.
300302

301303
If `fileextensions` attribute is not specified, then the validation is successful.
302304

test/TestValidator.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,10 @@ namespace shellanything { namespace test
198198
//assert success when more file extensions are allowed
199199
v.SetFileExtensions("ini;txt;bat;doc;msc;dll;exe;xls;");
200200
ASSERT_TRUE( v.Validate(c) );
201+
202+
//assert failure when multiple files are selected and a single extension is missing
203+
v.SetFileExtensions("dll;exe"); //missing msc file extension
204+
ASSERT_FALSE( v.Validate(c) );
201205
}
202206
//--------------------------------------------------------------------------------------------------
203207
TEST_F(TestValidator, testFileExists)

0 commit comments

Comments
 (0)