<commit_before>// Load modules

var Lab = require('lab');
var Hapi = require('../..');


// Declare internals

var internals = {};


// Test shortcuts

var expect = Lab.expect;
var before = Lab.before;
var after = Lab.after;
var describe = Lab.experiment;
var it = Lab.test;


describe('Validation', function () {

    it('validates valid input', function (done) {

        var server = new Hapi.Server();
        server.route({
            method: 'GET',
            path: '/',
            handler: function () { this.reply('ok'); },
            config: {
                validate: {
                    query: {
                        a: Hapi.types.String().min(2)
                    }
                }<commit_msg>test to confirm close #1004<commit_after>// Load modules

var Lab = require('lab');
var Hapi = require('../..');


// Declare internals

var internals = {};


// Test shortcuts

var expect = Lab.expect;
var before = Lab.before;
var after = Lab.after;
var describe = Lab.experiment;
var it = Lab.test;


describe('Validation', function () {

    it('validates valid input', function (done) {

        var server = new Hapi.Server();
        server.route({
            method: 'GET',
            path: '/',
            handler: function () { this.reply('ok'); },
            config: {
                validate: {
                    query: {
                        a: Hapi.types.String().min(2)
                    }
                }
            }
        });

        server.inject('/?a=123', function (res) {

            expect(res.statusCode).to.equal(200);
            done();
        });
    });

    it('validates valid input (Object root)', function (done) {

        var server = new Hapi.Server();
        server.route({
            method: 'GET',
            path: '/',
            handler: function () { this.reply('ok'); },
            config: {
                validate: {
                    query: Hapi.types.Object({
                        a: Hapi.types.String().min(2)
                    })
                }
{'fraction_non_alphanumeric': 0.14606741573033707, 'fraction_numerical': 0.006350757205666829, 'mean_word_length': 1.4294187425860023, 'pattern_counts': {'":': 0, '<': 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': '7034501', 'n_tokens_mistral': 586, 'n_tokens_neox': 544, 'n_words': 139}