Browse Source

Quick little test.

August Mueller 14 years ago
parent
commit
a6f77c9c91
1 changed files with 33 additions and 0 deletions
  1. 33 0
      src/fmdb.m

+ 33 - 0
src/fmdb.m

@@ -872,6 +872,39 @@ int main (int argc, const char * argv[]) {
         
     }
     
+    {
+        
+        [dbPool inDatabase:^(FMDatabase *db) {
+            [db executeUpdate:@"create table likefoo (foo text)"];
+            [db executeUpdate:@"insert into likefoo values ('hi')"];
+            [db executeUpdate:@"insert into likefoo values ('hello')"];
+            [db executeUpdate:@"insert into likefoo values ('not')"];
+            
+            int count = 0;
+            FMResultSet *rsl = [db executeQuery:@"select * from likefoo where foo like 'h%'"];
+            while ([rsl next]) {
+                count++;
+            }
+            
+            FMDBQuickCheck(count == 2);
+            
+            count = 0;
+            rsl = [db executeQuery:@"select * from likefoo where foo like ?", @"h%"];
+            while ([rsl next]) {
+                count++;
+            }
+            
+            FMDBQuickCheck(count == 2);
+        
+        }];
+        
+        
+    }
+    
+    
+    
+    
+    
     NSLog(@"That was version %@ of sqlite", [FMDatabase sqliteLibVersion]);
     
     [pool release];