<commit_before>'use strict'

import chai from 'chai'

import ifVowelsBeforeAndAfter from '@/wordbreaker-russian/rules/if-vowels-before-and-after'

describe(
    'ifVowelsBeforeAndAfter', () => {
        it(
            'Это функция',
            () => chai.assert.isFunction(ifVowelsBeforeAndAfter)
        )

        describe(
            'Правильно работает',
            () => {
                const testCaseArr = [
                    {
                        inputWord: 'просмотр',
                        expectedOutputData: [
                            {
                                position: 0,
                                result: true,
                            },
                            {
                                position: 1,
                                result: true,
                            },
                            {
                                position: 2,
                                result: false,
                            },
                            {
                                position: 3,
                                result: true,
                            },
                            {
                                position: 4,
                                result: true,
                            },
                            {
                                position: 5,
                                result: true,
                            },
                            {
                                position: 6,
                                result: true,
                            },
                        ],
                    },
                    {
                        inputWord: 'страх',
                        expectedOutputData: [
                            {
                                position: 0,
                                result: true,
                            },
                            {
                                position: 1,
                                result: true,
                            },
                            {
                                position: 2,
                                result: true,
                            },
                            {
                                position: 3,
                                result: true,
                            },
                        ],
                    },
                ]

                testCaseArr.forEach(
                    ({inputWord, expectedOutputData}) => {
                        it(
                            inputWord,
                            () => {
                                expectedOutputData.forEach(
                                    ({position, result}) => {
                                        chai.assert.equal(
                                            ifVowelsBeforeAndAfter(
                                                position,
                                                inputWord
                                            ),
                                            result
                                        )
                                    }
                                )
                            }
                        )
                    }
                )
            }
        )
    }
)
<commit_msg>Test, ifVowelsBeforeAndAfter: fix test cases; #7<commit_after>'use strict'

import chai from 'chai'

import ifVowelsBeforeAndAfter from '@/wordbreaker-russian/rules/if-vowels-before-and-after'

describe(
    'ifVowelsBeforeAndAfter', () => {
        it(
            'Это функция',
            () => chai.assert.isFunction(ifVowelsBeforeAndAfter)
        )

        describe(
            'Правильно работает',
            () => {
                const testCaseArr = [
                    {
                        inputWord: 'околоток',
                        expectedOutputData: [
                            true,
                            true,
                            true,
                            true,
                            true,
                            true,
                            false,
                            false,
                        ],
                    },
                    {
                        inputWord: 'просмотр',
                        expectedOutputData: [
                            false,
                            false,
                            true,
                            true,
                            true,
                            false,
                            false,
                            false,
                        ],
                    },
                    {
                        inputWord: 'страх',
                        expectedOutputData: [
                            false,
                            false,
                            false,
                            false,
                            false,
                        ],
                    },
                    {
                        inputWord: 'ноосфера',
                        expectedOutputData: [
                            false,
                            true,
                            true,
                            true,
                            true,
                            true,
                            true,
                            false,
                        ],
                    },
                ]

                testCaseArr.forEach(
                    ({inputWord, expectedOutputData}) => {
                        it(
                            inputWord,
                            () => {
                                expectedOutputData.forEach(
                                    (result, i) => {
                                        chai.assert.equal(
                                            ifVowelsBeforeAndAfter(
                                                i,
                                                inputWord
                                            ),
                                            result
                                        )
                                    }
                                )
                            }
                        )
                    }
                )
            }
        )
    }
)

{'fraction_non_alphanumeric': 0.057626056999686814, 'fraction_numerical': 0.0018791105543376136, 'mean_word_length': 0.36620320855614974, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 28, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3129272', 'n_tokens_mistral': 1164, 'n_tokens_neox': 1083, 'n_words': 164}