Updated method names in tests
This commit is contained in:
parent
8ecf77f760
commit
f7fc8a6eca
|
@ -43,7 +43,6 @@ static NSString *const kExpectedErrorDomain = @"com.google.mediapipe.tasks";
|
||||||
|
|
||||||
#define AssertTextClassifierResultHasOneHead(textClassifierResult) \
|
#define AssertTextClassifierResultHasOneHead(textClassifierResult) \
|
||||||
XCTAssertNotNil(textClassifierResult); \
|
XCTAssertNotNil(textClassifierResult); \
|
||||||
\
|
|
||||||
XCTAssertNotNil(textClassifierResult.classificationResult); \
|
XCTAssertNotNil(textClassifierResult.classificationResult); \
|
||||||
XCTAssertEqual(textClassifierResult.classificationResult.classifications.count, 1); \
|
XCTAssertEqual(textClassifierResult.classificationResult.classifications.count, 1); \
|
||||||
XCTAssertEqual(textClassifierResult.classificationResult.classifications[0].headIndex, 0);
|
XCTAssertEqual(textClassifierResult.classificationResult.classifications[0].headIndex, 0);
|
||||||
|
@ -156,7 +155,7 @@ static NSString *const kExpectedErrorDomain = @"com.google.mediapipe.tasks";
|
||||||
AssertEqualErrors(error, expectedError);
|
AssertEqualErrors(error, expectedError);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testCreateTextClassifierFailsWithBothAllowListAndDenyList {
|
- (void)testCreateTextClassifierFailsWithBothAllowlistAndDenylist {
|
||||||
MPPTextClassifierOptions *options =
|
MPPTextClassifierOptions *options =
|
||||||
[self textClassifierOptionsWithModelName:kBertTextClassifierModelName];
|
[self textClassifierOptionsWithModelName:kBertTextClassifierModelName];
|
||||||
options.categoryAllowlist = @[ @"positive" ];
|
options.categoryAllowlist = @[ @"positive" ];
|
||||||
|
@ -233,7 +232,7 @@ static NSString *const kExpectedErrorDomain = @"com.google.mediapipe.tasks";
|
||||||
expectedBertResultCategoriesForEdgeCaseTests]];
|
expectedBertResultCategoriesForEdgeCaseTests]];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testClassifyWithCategoryAllowListSucceeds {
|
- (void)testClassifyWithCategoryAllowlistSucceeds {
|
||||||
MPPTextClassifierOptions *options =
|
MPPTextClassifierOptions *options =
|
||||||
[self textClassifierOptionsWithModelName:kBertTextClassifierModelName];
|
[self textClassifierOptionsWithModelName:kBertTextClassifierModelName];
|
||||||
options.categoryAllowlist = @[ @"negative" ];
|
options.categoryAllowlist = @[ @"negative" ];
|
||||||
|
@ -250,7 +249,7 @@ static NSString *const kExpectedErrorDomain = @"com.google.mediapipe.tasks";
|
||||||
expectedBertResultCategoriesForEdgeCaseTests]];
|
expectedBertResultCategoriesForEdgeCaseTests]];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testClassifyWithCategoryDenyListSucceeds {
|
- (void)testClassifyWithCategoryDenylistSucceeds {
|
||||||
MPPTextClassifierOptions *options =
|
MPPTextClassifierOptions *options =
|
||||||
[self textClassifierOptionsWithModelName:kBertTextClassifierModelName];
|
[self textClassifierOptionsWithModelName:kBertTextClassifierModelName];
|
||||||
options.categoryDenylist = @[ @"positive" ];
|
options.categoryDenylist = @[ @"positive" ];
|
||||||
|
|
|
@ -147,7 +147,7 @@ class TextClassifierTests: XCTestCase {
|
||||||
""")
|
""")
|
||||||
}
|
}
|
||||||
|
|
||||||
func testCreateTextClassifierWithCategoryAllowlistandDenylistFails() throws {
|
func testCreateTextClassifierWithCategoryAllowlistAndDenylistFails() throws {
|
||||||
|
|
||||||
let textClassifierOptions =
|
let textClassifierOptions =
|
||||||
try XCTUnwrap(
|
try XCTUnwrap(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user