[sword-svn] r3406 - in trunk/bindings/objc: src test

mdbergmann at crosswire.org mdbergmann at crosswire.org
Mon Feb 15 03:12:50 MST 2016


Author: mdbergmann
Date: 2016-02-15 03:12:50 -0700 (Mon, 15 Feb 2016)
New Revision: 3406

Modified:
   trunk/bindings/objc/src/SwordModule.mm
   trunk/bindings/objc/test/SwordModuleTest.m
Log:
tests for strong's numbers search.

Modified: trunk/bindings/objc/src/SwordModule.mm
===================================================================
--- trunk/bindings/objc/src/SwordModule.mm	2016-02-10 20:39:22 UTC (rev 3405)
+++ trunk/bindings/objc/src/SwordModule.mm	2016-02-15 10:12:50 UTC (rev 3406)
@@ -547,7 +547,9 @@
 - (NSArray *)entryAttributeValuesLemma {
     NSMutableArray *array = [NSMutableArray array];
     
-    // parse entry attributes and look for Lemma (String's numbers)
+    swModule->stripText(); // force processing of key
+    
+    // parse entry attributes and look for Lemma (Strong's numbers)
     sword::AttributeTypeList::iterator words;
     sword::AttributeList::iterator word;
     sword::AttributeValue::iterator strongVal;

Modified: trunk/bindings/objc/test/SwordModuleTest.m
===================================================================
--- trunk/bindings/objc/test/SwordModuleTest.m	2016-02-10 20:39:22 UTC (rev 3405)
+++ trunk/bindings/objc/test/SwordModuleTest.m	2016-02-15 10:12:50 UTC (rev 3406)
@@ -80,8 +80,22 @@
     SwordBibleTextEntry *text = (SwordBibleTextEntry *) [bible textEntryForKeyString:@"Mat 4:4" textType:TextTypeRendered];
     XCTAssertTrue(text != nil);
     NSLog(@"Mat 4:4: %@", [text text]);
+    XCTAssertTrue([[text text] containsString:@"But he answered and said, <font color=\"red\"> It is written, Man shall not live by bread alone, but by every word that proceedeth out of the mouth of God.</font>"]);
 }
 
+- (void)testStrongsNumberRetrieval {
+    SwordBible *bible = (SwordBible *)[mgr moduleWithName:@"KJV"];
+    XCTAssertNotNil(bible, @"Module is nil");
+
+    [bible setKeyString:@"Gen 1:1"];
+    NSArray *strongsNumbers = [bible entryAttributeValuesLemma];
+    XCTAssertTrue(strongsNumbers != nil);
+    XCTAssertTrue([strongsNumbers count] > 0);
+    NSString *combinedString = [strongsNumbers componentsJoinedByString:@","];
+    NSLog(@"%@", combinedString);
+    XCTAssertTrue([@"H07225,H0430,H0853 H01254,H08064,H0853,H0776" isEqualToString:combinedString]);
+}
+
 - (void)testFirstBookNTIntroGer {
     SwordBible *bible = (SwordBible *)[mgr moduleWithName:@"GerNeUe"];
 




More information about the sword-cvs mailing list