<commit_before>class SearchSpec extends spock.lang.Specification {
    def "GString in search() method"() {
        given: "a simple query"
        def q = "Bin1"

        when: "I search inventory items with a GString including that query"
        def results = InventoryItem.search("*${q}*")

        then: "I get 2 results"
        results.total == 2
    }
}<commit_msg>Added test case for GRAILSPLUGINS-413: query builder le() wasn't working.<commit_after>class SearchSpec extends spock.lang.Specification {
    def "GString in search() method"() {
        given: "a simple query"
        def q = "Bin1"

        when: "I search inventory items with a GString including that query"
        def results = InventoryItem.search("*${q}*")

        then: "I get 2 results"
        results.total == 2
    }

    def "Query builder with integer constraints"() {
        given: "A bunch of books"
        new Book(title: "The Shining", author: "<NAME>", numOfPages: 300).save()
        new Book(title: "Misery", author: "<NAME>", numOfPages: 200).save()
        new Book(title: "Colossus", author: "<NAME>", numOfPages: 450).save()
        new Book(title: "The Liar", author: "<NAME>", numOfPages: 320).save()
        new Book(title: "Carrie", author: "<NAME>", numOfPages: 189).save()

        when: "I search for all books with fewer than 300 pages"
        def result = Book.search {
            lt "numOfPages", 300
        }

        then: "I get 2 books back"
        result.total == 2

        when: "I search for all books with 300 or fewer pages"
        result = Book.search {
            must(le("numOfPages", 300))
        }

        then: "I get 3 books back"
        result.total == 3
    }
}
{'fraction_non_alphanumeric': 0.12514688601645124, 'fraction_numerical': 0.023501762632197415, 'mean_word_length': 2.3924302788844622, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '5327456', 'n_tokens_mistral': 544, 'n_tokens_neox': 492, 'n_words': 179}