Skip to content

Commit

Permalink
[pigeon] Fix unittests for swift generator
Browse files Browse the repository at this point in the history
  • Loading branch information
bc-lee committed Apr 26, 2024
1 parent 800ba60 commit 8fa6b75
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/pigeon/test/swift_generator_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ void main() {
);
final String code = sink.toString();
expect(code,
contains('completion: @escaping (Result<Void, FlutterError>) -> Void'));
contains('completion: @escaping (Result<Void, PigeonError>) -> Void'));
expect(code, contains('completion(.success(Void()))'));
expect(code, isNot(contains('if (')));
});
Expand Down Expand Up @@ -476,7 +476,7 @@ void main() {
expect(
code,
contains(
'func doSomething(completion: @escaping (Result<Output, FlutterError>) -> Void)'));
'func doSomething(completion: @escaping (Result<Output, PigeonError>) -> Void)'));
expect(code, contains('channel.sendMessage(nil'));
expect(code, isNot(contains('if (')));
});
Expand Down Expand Up @@ -961,7 +961,7 @@ void main() {
expect(
code,
contains(
'func doit(completion: @escaping (Result<[Int64?], FlutterError>) -> Void)'));
'func doit(completion: @escaping (Result<[Int64?], PigeonError>) -> Void)'));
expect(code, contains('let result = listResponse[0] as! [Int64?]'));
expect(code, contains('completion(.success(result))'));
});
Expand Down Expand Up @@ -1049,7 +1049,7 @@ void main() {
expect(
code,
contains(
'func add(x xArg: Int64, y yArg: Int64, completion: @escaping (Result<Int64, FlutterError>) -> Void)'));
'func add(x xArg: Int64, y yArg: Int64, completion: @escaping (Result<Int64, PigeonError>) -> Void)'));
expect(code,
contains('channel.sendMessage([xArg, yArg] as [Any?]) { response in'));
});
Expand Down Expand Up @@ -1189,7 +1189,7 @@ void main() {
expect(
code,
contains(
'func doit(foo fooArg: Int64?, completion: @escaping (Result<Void, FlutterError>) -> Void)'));
'func doit(foo fooArg: Int64?, completion: @escaping (Result<Void, PigeonError>) -> Void)'));
});

test('nonnull fields', () {
Expand Down Expand Up @@ -1569,6 +1569,6 @@ void main() {
expect(
code,
contains(
'return FlutterError(code: "channel-error", message: "Unable to establish connection on channel: \'\\(channelName)\'.", details: "")'));
'return PigeonError(code: "channel-error", message: "Unable to establish connection on channel: \'\\(channelName)\'.", details: "")'));
});
}

0 comments on commit 8fa6b75

Please sign in to comment.