<commit_before>import XCTest
@testable import FluentSQLite
import Fluent
import Foundation

class JoinTests: XCTestCase {
    static let allTests = [
        ("testBasic", testBasic)
    ]

    var database: Fluent.Database!
    var driver: SQLiteDriver!

    override func setUp() {
        driver = SQLiteDriver.makeTestConnection()
        database = Database(driver)
    }

    func testBasic() throws {
        try Atom.revert(database)
        try Compound.revert(database)
        try Pivot<Atom, Compound>.revert(database)

        try Atom.prepare(database)
        try Compound.prepare(database)
        try Pivot<Atom, Compound>.prepare(database)

        Atom.database = database
        Compound.database = database
        Pivot<Atom, Compound>.database = database

        var hydrogen = Atom(name: "Hydrogen", protons: 1)
        try hydrogen.save()

        var water = Compound(name: "Water")
        try water.save()
        var hydrogenWater = Pivot<Atom, Compound>(hydrogen, water)
        try hydrogenWater.save()

        var sugar = Compound(name: "Sugar")
        try sugar.save()
        var hydrogenSugar = Pivot<Atom, Compound>(hydrogen, sugar)
        try hydrogenSugar.save()


        let compounds = try hydrogen.compounds().all()
        XCTAssertEqual(compounds.count, 2)
        XCTAssertEqual(compounds.first?.id?.int, water.id?.int)
        XCTAssertEqual(compounds.last?.id?.int, sugar.id?.int)
    }
}
<commit_msg>removed extra import statement<commit_after>import XCTest
@testable import FluentSQLite
import Fluent

class JoinTests: XCTestCase {
    static let allTests = [
        ("testBasic", testBasic)
    ]

    var database: Fluent.Database!
    var driver: SQLiteDriver!

    override func setUp() {
        driver = SQLiteDriver.makeTestConnection()
        database = Database(driver)
    }

    func testBasic() throws {
        try Atom.revert(database)
        try Compound.revert(database)
        try Pivot<Atom, Compound>.revert(database)

        try Atom.prepare(database)
        try Compound.prepare(database)
        try Pivot<Atom, Compound>.prepare(database)

        Atom.database = database
        Compound.database = database
        Pivot<Atom, Compound>.database = database

        var hydrogen = Atom(name: "Hydrogen", protons: 1)
        try hydrogen.save()

        var water = Compound(name: "Water")
        try water.save()
        var hydrogenWater = Pivot<Atom, Compound>(hydrogen, water)
        try hydrogenWater.save()

        var sugar = Compound(name: "Sugar")
        try sugar.save()
        var hydrogenSugar = Pivot<Atom, Compound>(hydrogen, sugar)
        try hydrogenSugar.save()


        let compounds = try hydrogen.compounds().all()
        XCTAssertEqual(compounds.count, 2)
        XCTAssertEqual(compounds.first?.name.string, water.name.string)
        XCTAssertEqual(compounds.last?.id?.int, sugar.id?.int)
    }
}

{'fraction_non_alphanumeric': 0.10230003432887058, 'fraction_numerical': 0.0013731548232063166, 'mean_word_length': 2.6516290726817044, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '6867889', 'n_tokens_mistral': 895, 'n_tokens_neox': 825, 'n_words': 197}