<commit_before>package com.nhaarman.expect

fun <T> expect(actual: T?): NumberMatcher<T> where T : Number, T : Comparable<T> {
    return NumberMatcher(actual)
}

class NumberMatcher<T>(actual: T?) : Matcher<T>(actual) where T : Number, T : Comparable<T> {

    fun toBeSmallerThan(expected: T, reason: () -> Any = { "" }) {
        if (actual === null) {
            fail(reason) {
                expected("actual value") {
                    to ("be smaller than") { expected }
                    but("the actual value was null")
                }
            }
            return
        }

        if (actual >= expected ) {
            fail(reason) {
                expected(actual) { to("be smaller than") { expected } }
            }
        }
    }

    fun toBeGreaterThan(expected: T, reason: () -> Any = { "" }) {
        if (actual === null) {
            fail(reason) {
                expected("actual value") {
                    to ("be greater than") { expected }
                    but("the actual value was null")
                }
            }
            return
        }

        if (actual <= expected ) {
            fail(reason) {
                expected(actual) { to("be greater than") { expected } }
            }
        }
    }

    fun toBeIn(expected: Range<T>, reason: () -> Any = { "" }) {
        if (actual === null) {
            fail(reason) {<commit_msg>Use ClosedRange instead of the deprecated Range<commit_after>package com.nhaarman.expect

fun <T> expect(actual: T?): NumberMatcher<T> where T : Number, T : Comparable<T> {
    return NumberMatcher(actual)
}

class NumberMatcher<T>(actual: T?) : Matcher<T>(actual) where T : Number, T : Comparable<T> {

    fun toBeSmallerThan(expected: T, reason: () -> Any = { "" }) {
        if (actual === null) {
            fail(reason) {
                expected("actual value") {
                    to ("be smaller than") { expected }
                    but("the actual value was null")
                }
            }
            return
        }

        if (actual >= expected ) {
            fail(reason) {
                expected(actual) { to("be smaller than") { expected } }
            }
        }
    }

    fun toBeGreaterThan(expected: T, reason: () -> Any = { "" }) {
        if (actual === null) {
            fail(reason) {
                expected("actual value") {
                    to ("be greater than") { expected }
                    but("the actual value was null")
                }
            }
            return
        }

        if (actual <= expected ) {
            fail(reason) {
                expected(actual) { to("be greater than") { expected } }
            }
        }
    }

    fun toBeIn(expected: ClosedRange<T>, reason: () -> Any = { "" }) {
        if (actual === null) {
            fail(reason) {
{'fraction_non_alphanumeric': 0.1352112676056338, 'fraction_numerical': 0.0, 'mean_word_length': 1.4302822925577416, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 25, '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': '978658', 'n_tokens_mistral': 790, 'n_tokens_neox': 756, 'n_words': 194}