<commit_before>import XCTest
import GRDB

class DatabaseQueueTests: GRDBTestCase {

    func testSwiftCompiler() {
        // Here we test that Swift compiler compiles some various usages of
        // DatabaseQueue.inDatabase { ... }
        let dbQueue = DatabaseQueue()
        
        assertNoError {
            try dbQueue.inDatabase { db in
                try db.execute("CREATE TABLE foo (id INTEGER PRIMARY KEY")
            }
        }
        
        assertNoError {
            try dbQueue.inDatabase { db in
                try db.execute("CREATE TABLE foo (id INTEGER PRIMARY KEY")
                try db.execute("CREATE TABLE bar (id INTEGER PRIMARY KEY")
            }
        }
        
        do {
            dbQueue.inDatabase { db in
                let x = 1
            }
        }
        
        do {
            let x = dbQueue.inDatabase { db in
                1
            }
        }
        
        do {
            dbQueue.inDatabase { db in
                1
            }
        }
        
        do {
            let x = dbQueue.inDatabase { db in
                let a = 1
                let b = 2
                return a + b
            }
        }
        
        do {
            dbQueue.inDatabase { db in
                let a = 1
                let b = 2
                return a + b
            }
        }
    }
}<commit_msg>More failing tests for issue #53<commit_after>import XCTest
import GRDB

class DatabaseQueueTests: GRDBTestCase {

    func testSwiftCompiler() {
        // Here we test that Swift compiler compiles some various usages of
        // DatabaseQueue.inDatabase { ... }
        
        assertNoError {
            let dbQueue = DatabaseQueue()
            try dbQueue.inDatabase { db in
                try db.execute("CREATE TABLE foo (id INTEGER PRIMARY KEY")
            }
        }
        
        assertNoError {
            let dbQueue = DatabaseQueue()
            try dbQueue.inDatabase { db in
                try db.execute("CREATE TABLE foo (id INTEGER PRIMARY KEY")
                try db.execute("CREATE TABLE bar (id INTEGER PRIMARY KEY")
            }
        }
        
        assertNoError {
            let dbQueue = DatabaseQueue()
            // TODO: make it compile
            try dbQueue.inDatabase { db in
                try db.execute("CREATE TABLE foo (id INTEGER PRIMARY KEY")
                return 1
            }
        }
        
        assertNoError {
            let dbQueue = DatabaseQueue()
            // TODO: make it compile
            let x = try dbQueue.inDatabase { db in
                try db.execute("CREATE TABLE foo (id INTEGER PRIMARY KEY")
                return 1
            }
        }
        
        do {
            let dbQueue = DatabaseQueue()
            dbQueue.inDatabase { db in
                let x = 1
            }
        }
        
        do {
            let dbQueue = DatabaseQueue()
            let x = dbQueue.inDatabase { db in
                1
            }
        }
        
        do {
            let dbQueue = DatabaseQueue()
            dbQueue.inDatabase { db in
                1
            }
        }
        
        do {
            let dbQueue = DatabaseQueue()
            // TODO: make it compile
            let x = dbQueue.inDatabase { db in
                let a = 1
                let b = 2
                return a + b
            }
        }
        
        do {
            // TODO: make it compile
            dbQueue.inDatabase { db in
                let a = 1
                let b = 2
                return a + b
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.06241407753643113, 'fraction_numerical': 0.004949133901567226, 'mean_word_length': 0.9340776182881446, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5008672', 'n_tokens_mistral': 946, 'n_tokens_neox': 877, 'n_words': 284}