<commit_before>import {UrlRule, IUrlParams} from '../src/UrlRule';
import 'mocha';
import { should } from 'chai';
import { withData } from 'leche';

const assert = should();

describe('Rules', function() {
    withData({
        "params" : [
            {
                name: "/foo/<id:(\\d+)>/bar/<type:(first|second)>",
                route : "/foo/bar",
                params : {
                    id : 10,
                    type : "first"
                },
            },
            "/foo/10/bar/first"
        ],
        "without params": [
            {
                name: "/foobarurl",
                route : "/foo/bar",
                params : {},
            },
            "/foobarurl"
        ],
        "invalid params": [
            {
                name: "/foo/<id:(\\d+)>/bar/<type:(first|second)>",
                route : "/foo/bar",
                params : {
                    id: 10,
                    type : "third"
                },
            },
            "/foo/bar?id=10&type=third"
        ],
    }, function(rule, expected) {
        it('should be corrected', function() {<commit_msg>Test run name<commit_after>import {UrlRule, IUrlParams} from '../src/UrlRule';
import 'mocha';
import { should } from 'chai';
import { withData } from 'leche';

const assert = should();

describe('Rules', function() {
    withData({
        "params" : [
            {
                name: "/foo/<id:(\\d+)>/bar/<type:(first|second)>",
                route : "/foo/bar",
                params : {
                    id : 10,
                    type : "first"
                },
            },
            "/foo/10/bar/first"
        ],
        "empty params": [
            {
                name: "/foobarurl",
                route : "/foo/bar",
                params : {},
            },
            "/foobarurl"
        ],
        "invalid params": [
            {
                name: "/foo/<id:(\\d+)>/bar/<type:(first|second)>",
                route : "/foo/bar",
                params : {
                    id: 10,
                    type : "third"
                },
            },
            "/foo/bar?id=10&type=third"
        ],
    }, function(rule, expected) {
        it('should be corrected', function() {
{'fraction_non_alphanumeric': 0.16313932980599646, 'fraction_numerical': 0.007054673721340388, 'mean_word_length': 1.0459873760144274, 'pattern_counts': {'":': 4, '<': 11, '<?xml version=': 0, '>': 11, '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': '7521963', 'n_tokens_mistral': 675, 'n_tokens_neox': 616, 'n_words': 118}