-
-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add failure test cases for
Sequence<N>
- Loading branch information
Showing
76 changed files
with
2,002 additions
and
6 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
errors/src/protobuf/error_protobuf_sequence_property_duplicated.ts
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,27 @@ | ||
import typia, { tags } from "typia"; | ||
|
||
interface IPointer<T> { | ||
value: T; | ||
} | ||
interface Something { | ||
id: string & tags.Sequence<1>; | ||
age: number & tags.Sequence<1>; | ||
} | ||
|
||
// MESSAGE | ||
typia.protobuf.message<Something>(); | ||
typia.protobuf.message<IPointer<Something>>(); | ||
typia.protobuf.message<IPointer<Something[]>>(); | ||
typia.protobuf.message<IPointer<Map<string, Something>>>(); | ||
|
||
// DECODE | ||
typia.protobuf.createDecode<Something>(); | ||
typia.protobuf.createDecode<IPointer<Something>>(); | ||
typia.protobuf.createDecode<IPointer<Something[]>>(); | ||
typia.protobuf.createDecode<IPointer<Map<string, Something>>>(); | ||
|
||
// ENCODE | ||
typia.protobuf.createEncode<Something>(); | ||
typia.protobuf.createEncode<IPointer<Something>>(); | ||
typia.protobuf.createEncode<IPointer<Something[]>>(); | ||
typia.protobuf.createEncode<IPointer<Map<string, Something>>>(); |
32 changes: 32 additions & 0 deletions
32
errors/src/protobuf/error_protobuf_sequence_union_duplicated.ts
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,32 @@ | ||
import typia, { tags } from "typia"; | ||
|
||
interface IPointer<T> { | ||
value: T; | ||
} | ||
interface Something { | ||
id: | ||
| (number & tags.Type<"uint32"> & tags.Sequence<1>) | ||
| (number & tags.Type<"double"> & tags.Sequence<2>) | ||
| (string & tags.Sequence<3>); | ||
sex: | ||
| (number & tags.Type<"uint32"> & tags.Sequence<4>) | ||
| (string & tags.Sequence<3>); | ||
} | ||
|
||
// MESSAGE | ||
typia.protobuf.message<Something>(); | ||
typia.protobuf.message<IPointer<Something>>(); | ||
typia.protobuf.message<IPointer<Something[]>>(); | ||
typia.protobuf.message<IPointer<Map<string, Something>>>(); | ||
|
||
// DECODE | ||
typia.protobuf.createDecode<Something>(); | ||
typia.protobuf.createDecode<IPointer<Something>>(); | ||
typia.protobuf.createDecode<IPointer<Something[]>>(); | ||
typia.protobuf.createDecode<IPointer<Map<string, Something>>>(); | ||
|
||
// ENCODE | ||
typia.protobuf.createEncode<Something>(); | ||
typia.protobuf.createEncode<IPointer<Something>>(); | ||
typia.protobuf.createEncode<IPointer<Something[]>>(); | ||
typia.protobuf.createEncode<IPointer<Map<string, Something>>>(); |
29 changes: 29 additions & 0 deletions
29
errors/src/protobuf/error_protobuf_sequence_union_omitted.ts
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,29 @@ | ||
import typia, { tags } from "typia"; | ||
|
||
interface IPointer<T> { | ||
value: T; | ||
} | ||
interface Something { | ||
id: | ||
| (number & tags.Type<"uint32"> & tags.Sequence<1>) | ||
| (number & tags.Type<"double"> & tags.Sequence<2>) | ||
| string; | ||
} | ||
|
||
// MESSAGE | ||
typia.protobuf.message<Something>(); | ||
typia.protobuf.message<IPointer<Something>>(); | ||
typia.protobuf.message<IPointer<Something[]>>(); | ||
typia.protobuf.message<IPointer<Map<string, Something>>>(); | ||
|
||
// DECODE | ||
typia.protobuf.createDecode<Something>(); | ||
typia.protobuf.createDecode<IPointer<Something>>(); | ||
typia.protobuf.createDecode<IPointer<Something[]>>(); | ||
typia.protobuf.createDecode<IPointer<Map<string, Something>>>(); | ||
|
||
// ENCODE | ||
typia.protobuf.createEncode<Something>(); | ||
typia.protobuf.createEncode<IPointer<Something>>(); | ||
typia.protobuf.createEncode<IPointer<Something[]>>(); | ||
typia.protobuf.createEncode<IPointer<Map<string, Something>>>(); |
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
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,27 @@ | ||
syntax = "proto3"; | ||
|
||
message ObjectSequenceProtobuf { | ||
repeated ObjectSequenceProtobuf.IMember value = 1; | ||
message IMember { | ||
oneof id { | ||
bytes v13 = 13; | ||
uint64 v12 = 12; | ||
string v11 = 11; | ||
} | ||
optional string name = 20; | ||
repeated ObjectSequenceProtobuf.IMember children = 30; | ||
map<string, string> keywords = 40; | ||
oneof thumbnail { | ||
bytes v41 = 41; | ||
string v42 = 42; | ||
} | ||
required string email = 43; | ||
repeated ObjectSequenceProtobuf.IHobby hobbies = 44; | ||
} | ||
|
||
message IHobby { | ||
required string id = 1; | ||
required string name = 2; | ||
required bool valid = 3; | ||
} | ||
} |
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
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
Oops, something went wrong.