Skip to content

Commit 05d07ea

Browse files
committed
Tests
1 parent 62d6bb7 commit 05d07ea

File tree

4 files changed

+163
-209
lines changed

4 files changed

+163
-209
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ URL, min, max, minLength, maxLength, minWordsCount, maxWordsCount, IP, credit ca
148148

149149
- `FormBuilderValidator.and()` - Combines the current validator with another validator using logical AND.
150150
- `FormBuilderValidator.or()` - Combines the current validator with another validator using logical OR.
151-
- `FormBuilderValidator.not()` - Negates the current validator.
152151
- `FormBuilderValidator.when()` - Adds a condition to apply the validator only if the condition is met.
153152
- `FormBuilderValidator.unless()` - Adds a condition to apply the validator only if the condition is not met.
154153
- `FormBuilderValidator.transform()` - Transforms the value before applying the validator.

lib/src/form_field_validator_extensions.dart

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ extension FormFieldValidatorExtensions<T> on FormFieldValidator<T> {
1212
return FormBuilderValidators.or(<FormFieldValidator<T>>[this, other]);
1313
}
1414

15-
/// Negates the current validator.
16-
FormFieldValidator<T> not() {
17-
return FormBuilderValidators.notEqual(this);
18-
}
19-
2015
/// Adds a condition to apply the validator only if the condition is met.
2116
FormFieldValidator<T> when(bool Function(T? value) condition) {
2217
return FormBuilderValidators.conditional(condition, this);

test/src/file/path_validator_test.dart

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -118,25 +118,6 @@ void main() {
118118
expect(result, equals(FormBuilderLocalizations.current.pathErrorText));
119119
});
120120

121-
test('should use custom regex and return null for valid custom file paths',
122-
() {
123-
// Arrange
124-
final RegExp customRegex = RegExp(r'^[a-zA-Z0-9_\-\.\\]+$');
125-
final PathValidator validator = PathValidator(regex: customRegex);
126-
const List<String> validPaths = <String>[
127-
r'C:\Users\Name\Documents',
128-
r'folder\subfolder\file.txt',
129-
r'folder\subfolder\file-name.txt',
130-
r'folder123\subfolder456\file789.txt',
131-
r'\folder\sub-folder\file_name.txt',
132-
];
133-
134-
// Act & Assert
135-
for (final String value in validPaths) {
136-
expect(validator.validate(value), isNull);
137-
}
138-
});
139-
140121
test(
141122
'should use custom regex and return the default error message for invalid custom file paths',
142123
() {

0 commit comments

Comments
 (0)