<commit_before>
use serialize::json::{Json, JsonObject, ToJson};

use valico::{
    Builder,
    Coercer
};

use helpers::{
    test_error,
    assert_str_eq, 
    assert_result_key, 
    assert_error_key
};

#[test]
fn is_process_simple_require() {

    let params = Builder::build(|params| {
        params.req_defined("a");
    });

    assert_str_eq(&params, r#"{"a":1}"#, r#"{"a":1}"#);
    assert_error_key(&params, r#"{}"#, ["a", "validation"]);
}

#[test]
fn is_process_i64_require() {

    let params = Builder::build(|params| {
        params.req_typed("a", Builder::i64());
    });

    assert_str_eq(&params, r#"{"a":"1"}"#, r#"{"a":1}"#);
    <commit_msg>test: add specs to empty builder<commit_after>
use serialize::json::{Json, JsonObject, ToJson};

use valico::{
    Builder,
    Coercer
};

use helpers::{
    test_error,
    assert_str_eq, 
    assert_result_key, 
    assert_error_key
};

#[test]
fn is_process_empty_builder() {

    let params = Builder::build(|params| { });

    assert_str_eq(&params, r#"{"a":1}"#, r#"{"a":1}"#);
}

#[test]
fn is_process_simple_require() {

    let params = Builder::build(|params| {
        params.req_defined("a");
    });

    assert_str_eq(&params, r#"{"a":1}"#, r#"{"a":1}"#);
    assert_error_key(&params, r#"{}"#, ["a", "validation"]);
}

#[test]
fn is_process_i64_require() {

    let params = Builder::build(|params| {
        params.req_typed("a", Builder::i64());
    });

    assert_str_eq(&params, r#"{"a":"1"}"#, r#"{"a":1}"#);
    
{'fraction_non_alphanumeric': 0.2208915502328676, 'fraction_numerical': 0.011976047904191617, 'mean_word_length': 3.9966777408637872, 'pattern_counts': {'":': 10, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3345081', 'n_tokens_mistral': 597, 'n_tokens_neox': 581, 'n_words': 94}