-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Seven Du
committed
Jan 25, 2024
1 parent
98b828f
commit 23160e1
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import 'package:orm/orm.dart'; | ||
import 'package:test/test.dart'; | ||
|
||
import 'generated/client.dart'; | ||
import 'generated/prisma.dart'; | ||
|
||
void main() { | ||
late PrismaClient client; | ||
|
||
setUpAll(() async { | ||
client = PrismaClient(datasourceUrl: 'file:test/test.db'); | ||
await client.$connect(); | ||
|
||
// Clear database | ||
await client.user.deleteMany(); | ||
}); | ||
|
||
tearDownAll(() async { | ||
await client.$disconnect(); | ||
}); | ||
|
||
test('Encoding', () async { | ||
final chars = [ | ||
"中文", | ||
'😊', | ||
'にちほん', | ||
'한국어', | ||
'اَلْعَرَبِيَّةُ', | ||
'عربي/عربى', | ||
'خصوصي', | ||
]; | ||
for (final char in chars) { | ||
final user = await client.user.create( | ||
data: PrismaUnion.$2(UserUncheckedCreateInput(name: char)), | ||
); | ||
|
||
expect(user.name, char); | ||
|
||
final found = await client.user.findUniqueOrThrow( | ||
where: UserWhereUniqueInput(id: user.id), | ||
select: UserSelect(name: true), | ||
); | ||
expect(found.name, char); | ||
} | ||
}); | ||
} |
23160e1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
prisma-dart – ./
prisma-dart-git-main-herodeveloper.vercel.app
prisma-dart.vercel.app
prisma.pub
prisma-dart-herodeveloper.vercel.app
www.prisma.pub