diff options
author | Daniil Baturin <daniil@baturin.org> | 2015-04-26 15:01:13 +0600 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2015-04-26 15:01:13 +0600 |
commit | 35bbd44f54b2738027869d67c99f55c742945a5e (patch) | |
tree | 97639859ac8b7004927ad33c4d9090845f0029ad /test | |
parent | 124b2b2e1081e45bfd31bb71992f9b60550e6668 (diff) | |
download | vyconf-35bbd44f54b2738027869d67c99f55c742945a5e.tar.gz vyconf-35bbd44f54b2738027869d67c99f55c742945a5e.zip |
Make Value_checker.validate_any return true if constraint list is empty
(i.e. no constraints means anything goes).
Diffstat (limited to 'test')
-rw-r--r-- | test/value_checker_test.ml | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/value_checker_test.ml b/test/value_checker_test.ml index a975d93..169ed86 100644 --- a/test/value_checker_test.ml +++ b/test/value_checker_test.ml @@ -38,6 +38,10 @@ let test_validate_any_invalid test_ctxt = let cs = [Regex "\\d+"; Regex "[a-z]+"] in assert_equal (validate_any validators cs "AAAA") false +let test_validate_any_no_constraints test_ctxt = + let cs = [] in + assert_equal (validate_any validators cs "foo") true + let suite = "VyConf value checker tests" >::: [ "test_check_regex_valid" >:: test_check_regex_valid; @@ -47,6 +51,7 @@ let suite = "test_check_external_bad_validator" >:: test_check_external_bad_validator; "test_validate_any_valid" >:: test_validate_any_valid; "test_validate_any_invalid" >:: test_validate_any_invalid; + "test_validate_any_no_constraints" >:: test_validate_any_no_constraints; ] let () = |