Skip to content

Commit 8f836ae

Browse files
committed
update generator test case to verify unknown annotations are ignored without an error
1 parent 9791b0e commit 8f836ae

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
import "package:objectbox/objectbox.dart";
22
part "single_entity.g.dart";
33

4+
/// A dummy annotation to verify the code is generated properly even with annotations unknown to ObjectBox generator.
5+
class TestingUnknownAnnotation {
6+
const TestingUnknownAnnotation();
7+
}
8+
49
@Entity(uid: 1234)
10+
@TestingUnknownAnnotation()
511
class SingleEntity {
612
@Id(uid: 5678)
713
int id;
814

915
@Property(uid: 4321)
16+
@TestingUnknownAnnotation()
1017
String texta;
1118
}

test/entity.dart

+7
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,16 @@ import "package:objectbox/objectbox.dart";
22

33
part 'entity.g.dart';
44

5+
/// A dummy annotation to verify the code is generated properly even with annotations unknown to ObjectBox generator.
6+
class TestingUnknownAnnotation {
7+
const TestingUnknownAnnotation();
8+
}
9+
510
@Entity()
11+
@TestingUnknownAnnotation()
612
class TestEntity {
713
@Id()
14+
@TestingUnknownAnnotation()
815
int id;
916

1017
// implicitly determined types

0 commit comments

Comments
 (0)