forked from rooch-network/rooch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add nested test cases for data_struct with structs and vectors
- Loading branch information
1 parent
0c1e651
commit 6687b78
Showing
6 changed files
with
216 additions
and
0 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
...s/tests/cases/mvir_tests/data_struct/data_struct_valid_mixed_nested_struct_and_vector.exp
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,4 @@ | ||
processed 1 task | ||
|
||
task 0 'publish'. lines 1-86: | ||
status EXECUTED |
86 changes: 86 additions & 0 deletions
86
.../tests/cases/mvir_tests/data_struct/data_struct_valid_mixed_nested_struct_and_vector.mvir
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,86 @@ | ||
//# publish | ||
module 0x11.TestModule1 { | ||
import 0x1.string; | ||
import 0x2.table; | ||
import 0x1.option; | ||
|
||
struct Media has store, copy, drop { | ||
id: string.String, | ||
url: string.String, | ||
title: string.String, | ||
source: string.String, | ||
description: string.String, | ||
text: string.String, | ||
contentType: string.String, | ||
} | ||
|
||
struct Content has store, copy, drop { | ||
text: string.String, | ||
action: option.Option<string.String>, | ||
source: option.Option<string.String>, | ||
url: option.Option<string.String>, | ||
inReplyTo: option.Option<string.String>, | ||
attachments: vector<Self.Media>, | ||
} | ||
|
||
struct Memory has store, copy, drop { | ||
id: string.String, | ||
userId: string.String, | ||
agentId: string.String, | ||
createdAt: option.Option<u64>, | ||
content: Self.Content, | ||
character: string.String, | ||
embedding: vector<u128>, | ||
roomId: string.String, | ||
unique: bool, | ||
similarity: option.Option<u128>, | ||
} | ||
|
||
struct MessageTemplate has store, copy, drop{ | ||
user: string.String, | ||
content: Self.Content, | ||
} | ||
|
||
struct MemoryStore has key { | ||
agent_account: address, | ||
store: table.Table<string.String, Self.Memory>, | ||
} | ||
|
||
struct Style has store, copy, drop { | ||
all: vector<string.String>, | ||
chat: vector<string.String>, | ||
post: vector<string.String>, | ||
} | ||
|
||
struct Character has key { | ||
/// Optional UUID for the character. | ||
id: option.Option<string.String>, | ||
name: string.String, | ||
username: string.String, | ||
plugins: vector<string.String>, | ||
clients: vector<string.String>, | ||
modelProvider: string.String, | ||
imageModelProvider: option.Option<string.String>, | ||
imageVisionModelProvider: option.Option<string.String>, | ||
modelEndpointOverride: option.Option<string.String>, | ||
system: string.String, | ||
bio: vector<string.String>, | ||
lore: vector<string.String>, | ||
messageExamples: vector<vector<Self.MessageTemplate>>, | ||
postExamples: vector<string.String>, | ||
topics: vector<string.String>, | ||
style: Self.Style, | ||
adjectives: vector<string.String>, | ||
knowledge: vector<string.String>, | ||
} | ||
|
||
metadata { | ||
data_struct { | ||
0x11::TestModule1::Media -> true; | ||
0x11::TestModule1::Content -> true; | ||
0x11::TestModule1::Memory -> true; | ||
0x11::TestModule1::Style -> true; | ||
0x11::TestModule1::MessageTemplate -> true; | ||
} | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
...ch-framework-tests/tests/cases/mvir_tests/data_struct/data_struct_valid_nested_struct.exp
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,4 @@ | ||
processed 1 task | ||
|
||
task 0 'publish'. lines 1-51: | ||
status EXECUTED |
51 changes: 51 additions & 0 deletions
51
...h-framework-tests/tests/cases/mvir_tests/data_struct/data_struct_valid_nested_struct.mvir
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,51 @@ | ||
//# publish | ||
module 0x11.TestModule1 { | ||
import 0x1.string; | ||
import 0x2.table; | ||
import 0x1.option; | ||
|
||
struct Media has store, copy, drop { | ||
id: string.String, | ||
url: string.String, | ||
title: string.String, | ||
source: string.String, | ||
description: string.String, | ||
text: string.String, | ||
contentType: string.String, | ||
} | ||
|
||
struct Content has store, copy, drop { | ||
text: string.String, | ||
action: option.Option<string.String>, | ||
source: option.Option<string.String>, | ||
url: option.Option<string.String>, | ||
inReplyTo: option.Option<string.String>, | ||
attachments: vector<Self.Media>, | ||
} | ||
|
||
struct Memory has store, copy, drop { | ||
id: string.String, | ||
userId: string.String, | ||
agentId: string.String, | ||
createdAt: option.Option<u64>, | ||
content: Self.Content, | ||
character: string.String, | ||
embedding: vector<u128>, | ||
roomId: string.String, | ||
unique: bool, | ||
similarity: option.Option<u128>, | ||
} | ||
|
||
struct MemoryStore has key { | ||
agent_account: address, | ||
store: table.Table<string.String, Self.Memory>, | ||
} | ||
|
||
metadata { | ||
data_struct { | ||
0x11::TestModule1::Media -> true; | ||
0x11::TestModule1::Content -> true; | ||
0x11::TestModule1::Memory -> true; | ||
} | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
...ch-framework-tests/tests/cases/mvir_tests/data_struct/data_struct_valid_nested_vector.exp
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,4 @@ | ||
processed 1 task | ||
|
||
task 0 'publish'. lines 1-67: | ||
status EXECUTED |
67 changes: 67 additions & 0 deletions
67
...h-framework-tests/tests/cases/mvir_tests/data_struct/data_struct_valid_nested_vector.mvir
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,67 @@ | ||
//# publish | ||
module 0x11.TestModule1 { | ||
import 0x1.string; | ||
import 0x2.table; | ||
import 0x1.option; | ||
|
||
struct Style has store, copy, drop { | ||
all: vector<string.String>, | ||
chat: vector<string.String>, | ||
post: vector<string.String>, | ||
} | ||
|
||
struct Media has store, copy, drop { | ||
id: string.String, | ||
url: string.String, | ||
title: string.String, | ||
source: string.String, | ||
description: string.String, | ||
text: string.String, | ||
contentType: string.String, | ||
} | ||
|
||
struct Content has store, copy, drop { | ||
text: string.String, | ||
action: option.Option<string.String>, | ||
source: option.Option<string.String>, | ||
url: option.Option<string.String>, | ||
inReplyTo: option.Option<string.String>, | ||
attachments: vector<Self.Media>, | ||
} | ||
|
||
struct MessageTemplate has store, copy, drop{ | ||
user: string.String, | ||
content: Self.Content, | ||
} | ||
|
||
struct Character has key { | ||
/// Optional UUID for the character. | ||
id: option.Option<string.String>, | ||
name: string.String, | ||
username: string.String, | ||
plugins: vector<string.String>, | ||
clients: vector<string.String>, | ||
modelProvider: string.String, | ||
imageModelProvider: option.Option<string.String>, | ||
imageVisionModelProvider: option.Option<string.String>, | ||
modelEndpointOverride: option.Option<string.String>, | ||
system: string.String, | ||
bio: vector<string.String>, | ||
lore: vector<string.String>, | ||
messageExamples: vector<vector<Self.MessageTemplate>>, | ||
postExamples: vector<string.String>, | ||
topics: vector<string.String>, | ||
style: Self.Style, | ||
adjectives: vector<string.String>, | ||
knowledge: vector<string.String>, | ||
} | ||
|
||
metadata { | ||
data_struct { | ||
0x11::TestModule1::Style -> true; | ||
0x11::TestModule1::Content -> true; | ||
0x11::TestModule1::Media -> true; | ||
0x11::TestModule1::MessageTemplate -> true; | ||
} | ||
} | ||
} |