Skip to content

Commit b8a431c

Browse files
committed
test: migrate tests to specs format (#76)
1 parent 0bad42a commit b8a431c

File tree

264 files changed

+4257
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

264 files changed

+4257
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
send [COIN 1] + [COIN 2] (
3+
source = @world
4+
destination = @dest
5+
)
6+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"testCases": [
3+
{
4+
"it": "-",
5+
"expect.postings": [
6+
{
7+
"source": "world",
8+
"destination": "dest",
9+
"amount": 3,
10+
"asset": "COIN"
11+
}
12+
]
13+
}
14+
]
15+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
set_tx_meta("k", 1 + 2)
3+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"testCases": [
3+
{
4+
"it": "-",
5+
"expect.txMetadata": {
6+
"k": "3"
7+
}
8+
}
9+
]
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
send [CREDIT 200] (
2+
source = {
3+
@users:001
4+
@users:002
5+
}
6+
destination = {
7+
1/2 to @foo
8+
1/2 to @bar
9+
}
10+
)
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"testCases": [
3+
{
4+
"it": "-",
5+
"balances": {
6+
"users:001": {
7+
"CREDIT": 100
8+
},
9+
"users:002": {
10+
"CREDIT": 110
11+
}
12+
},
13+
"expect.postings": [
14+
{
15+
"source": "users:001",
16+
"destination": "foo",
17+
"amount": 100,
18+
"asset": "CREDIT"
19+
},
20+
{
21+
"source": "users:002",
22+
"destination": "bar",
23+
"amount": 100,
24+
"asset": "CREDIT"
25+
}
26+
]
27+
}
28+
]
29+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
vars {
2+
account $rider
3+
account $driver
4+
}
5+
send [GEM 15] (
6+
source = $rider
7+
destination = {
8+
80% to $driver
9+
8% to @a
10+
12% to @b
11+
}
12+
)
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"testCases": [
3+
{
4+
"it": "-",
5+
"balances": {
6+
"users:001": {
7+
"GEM": 15
8+
}
9+
},
10+
"variables": {
11+
"driver": "users:002",
12+
"rider": "users:001"
13+
},
14+
"expect.postings": [
15+
{
16+
"source": "users:001",
17+
"destination": "users:002",
18+
"amount": 13,
19+
"asset": "GEM"
20+
},
21+
{
22+
"source": "users:001",
23+
"destination": "a",
24+
"amount": 1,
25+
"asset": "GEM"
26+
},
27+
{
28+
"source": "users:001",
29+
"destination": "b",
30+
"amount": 1,
31+
"asset": "GEM"
32+
}
33+
]
34+
}
35+
]
36+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
vars {
3+
monetary $bal = balance(@alice, USD/2)
4+
}
5+
6+
send $bal (
7+
source = @alice
8+
destination = @dest
9+
)
10+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"testCases": [
3+
{
4+
"it": "-",
5+
"balances": {
6+
"alice": {
7+
"USD/2": 10
8+
}
9+
},
10+
"expect.postings": [
11+
{
12+
"source": "alice",
13+
"destination": "dest",
14+
"amount": 10,
15+
"asset": "USD/2"
16+
}
17+
]
18+
}
19+
]
20+
}

0 commit comments

Comments
 (0)