Skip to content

Commit

Permalink
Bring deleted test back and add throwsUnresolvedAnnotationException t…
Browse files Browse the repository at this point in the history
…o test_utils and expect the test to throw this exception
  • Loading branch information
hendrikvdkaaden committed Mar 8, 2024
1 parent af8a7ed commit acbf7e8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,19 @@ void main() {
expect(actual, equals({expected}));
});

test('throws error when empty list in annotation', () async {
const typeConverterScope = TypeConverterScope.database;
final element = await '''
@TypeConverters(null)
abstract class Foo {}
'''
.asClassElement();

final actual = () => element.getTypeConverters(typeConverterScope);

expect(actual, throwsUnresolvedAnnotationException());
});

test('throws error when empty list in annotation', () async {
const typeConverterScope = TypeConverterScope.database;
final element = await '''
Expand Down
6 changes: 6 additions & 0 deletions floor_generator/test/test_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ Matcher throwsProcessorError([
}
}

Matcher throwsUnresolvedAnnotationException() {
return throwsA(isA<UnresolvedAnnotationException>());
}



Future<Dao> createDao(final String methodSignature) async {
final library = await resolveSource('''
library test;
Expand Down

0 comments on commit acbf7e8

Please sign in to comment.