Fixed: Bundle test cases must run asynchronous as a bundle will also load asynchronous in Node.

Also removed some compilation warnings from the test cases.
This commit is contained in:
Martin Carlberg
2021-09-21 10:51:17 +02:00
parent 89757e35e6
commit 68f0cf27df
+5 -5
View File
@@ -27,22 +27,22 @@
- (void)testCreationMainBundle
{
var bundle = [CPBundle mainBundle];
[CPBundle mainBundle];
}
- (void)testLoadingBundle
- (async void)testLoadingBundle
{
var bundle = [CPBundle bundleWithPath:@"Tests/Foundation/BundleTest"];
[bundle loadWithDelegate:self];
await [bundle loadWithDelegate:self];
[self assert:[bundle objectForInfoDictionaryKey:"CPBundleDefaultLanguage"] equals:"fr"];
[self assert:[bundle objectForInfoDictionaryKey:"CPBundleLocalizableStrings"] equals:["Localizable.strings"]];
}
- (void)testLocalization
- (async void)testLocalization
{
var bundle = [CPBundle bundleWithPath:@"Tests/Foundation/BundleTest"];
[bundle loadWithDelegate:self];
await [bundle loadWithDelegate:self];
[self assert:[bundle localizedStringForKey:"Label from file" value:"" table:"Localizable"] equals:"Label traduit de fr.lproj du premier context"];
[self assert:[bundle localizedStringForKey:"Wrong key" value:"Default value" table:"Localizable"] equals:"Default value"];