Skip to content

Commit

Permalink
update goldmaster
Browse files Browse the repository at this point in the history
  • Loading branch information
Brat-vseznamus committed Oct 29, 2024
1 parent c37f072 commit 6f11136
Show file tree
Hide file tree
Showing 22 changed files with 1,690 additions and 265 deletions.
19 changes: 19 additions & 0 deletions internal/tlcodegen/test/codegen_test/goldmaster_invariants_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,22 @@ func TestFunctionHasUnion(t *testing.T) {
}
}
}

func TestFunctionHasUnionInArguments(t *testing.T) {
{
// test type which contains union in its recursive definition
fun := meta.FactoryItemByTLName("service5.insertList")
if assert.NotNil(t, fun) {
assert.True(t, fun.IsFunction())
assert.True(t, !fun.HasUnionTypesInArguments())
}
}
{
// test type which doesn't contain union in its recursive definition
fun := meta.FactoryItemByTLName("ab.call11")
if assert.NotNil(t, fun) {
assert.True(t, fun.IsFunction())
assert.True(t, fun.HasUnionTypesInArguments())
}
}
}
102 changes: 52 additions & 50 deletions internal/tlcodegen/test/gen/cases/meta/meta.go

Large diffs are not rendered by default.

223 changes: 220 additions & 3 deletions internal/tlcodegen/test/gen/goldmaster.tlo.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 301822800,
"date": 301822800,
"types_num": 99,
"types_num": 100,
"types": [
{
"name": 1885708031,
Expand Down Expand Up @@ -108,6 +108,12 @@
"id": "Int64",
"constructors_num": 1
},
{
"name": 47713501,
"id": "List",
"constructors_num": 1,
"arity": 1
},
{
"name": 570911930,
"id": "Long",
Expand Down Expand Up @@ -555,7 +561,7 @@
"params_type": 1
}
],
"constructor_num": 114,
"constructor_num": 115,
"constructors": [
{
"type": "tls.combinator_v4",
Expand Down Expand Up @@ -1909,6 +1915,99 @@
}
}
},
{
"type": "tls.combinator_v4",
"value": {
"name": 47713501,
"id": "list",
"type_name": 47713501,
"left": {
"type": "tls.combinatorLeft",
"value": {
"args_num": 4,
"args": [
{
"id": "X",
"flags": 131075,
"var_num": 0,
"type": {
"type": "tls.typeExpr",
"value": {
"name": 753727511
}
}
},
{
"id": "flag",
"flags": 2,
"var_num": 1,
"type": {
"type": "tls.typeExpr",
"value": {
"name": 1885708031
}
}
},
{
"id": "head",
"flags": 4,
"exist_var_num": 1,
"exist_var_bit": 0,
"type": {
"type": "tls.typeVar",
"value": {}
}
},
{
"id": "tail",
"flags": 4,
"exist_var_num": 1,
"exist_var_bit": 0,
"type": {
"type": "tls.typeExpr",
"value": {
"name": 47713501,
"flags": 1,
"children_num": 1,
"children": [
{
"type": "tls.exprType",
"value": {
"expr": {
"type": "tls.typeVar",
"value": {}
}
}
}
]
}
}
}
]
}
},
"right": {
"value": {
"type": "tls.typeExpr",
"value": {
"name": 47713501,
"children_num": 1,
"children": [
{
"type": "tls.exprType",
"value": {
"expr": {
"type": "tls.typeVar",
"value": {}
}
}
}
]
}
}
}
}
},
{
"type": "tls.combinator_v4",
"value": {
Expand Down Expand Up @@ -9289,7 +9388,7 @@
}
}
],
"functions_num": 21,
"functions_num": 24,
"functions": [
{
"type": "tls.combinator_v4",
Expand Down Expand Up @@ -9326,6 +9425,61 @@
"flags": 1
}
},
{
"type": "tls.combinator_v4",
"value": {
"name": -1917672200,
"id": "ab.call10",
"type_name": -516647077,
"left": {
"type": "tls.combinatorLeft",
"value": {}
},
"right": {
"value": {
"type": "tls.typeExpr",
"value": {
"name": -516647077
}
}
},
"flags": 1
}
},
{
"type": "tls.combinator_v4",
"value": {
"name": -323837076,
"id": "ab.call11",
"type_name": -516647077,
"left": {
"type": "tls.combinatorLeft",
"value": {
"args_num": 1,
"args": [
{
"id": "x",
"type": {
"type": "tls.typeExpr",
"value": {
"name": -516647077
}
}
}
]
}
},
"right": {
"value": {
"type": "tls.typeExpr",
"value": {
"name": -516647077
}
}
},
"flags": 1
}
},
{
"type": "tls.combinator_v4",
"value": {
Expand Down Expand Up @@ -9970,6 +10124,69 @@
"flags": 3
}
},
{
"type": "tls.combinator_v4",
"value": {
"name": 2096325308,
"id": "service5.insertList",
"type_name": 47713501,
"left": {
"type": "tls.combinatorLeft",
"value": {
"args_num": 2,
"args": [
{
"id": "flags",
"flags": 2,
"var_num": 0,
"type": {
"type": "tls.typeExpr",
"value": {
"name": 1885708031
}
}
},
{
"id": "persistent",
"flags": 4,
"exist_var_num": 0,
"exist_var_bit": 0,
"type": {
"type": "tls.typeExpr",
"value": {
"name": 1072550713,
"flags": 1
}
}
}
]
}
},
"right": {
"value": {
"type": "tls.typeExpr",
"value": {
"name": 47713501,
"children_num": 1,
"children": [
{
"type": "tls.exprType",
"value": {
"expr": {
"type": "tls.typeExpr",
"value": {
"name": 597193292
}
}
}
}
]
}
}
},
"flags": 3
}
},
{
"type": "tls.combinator_v4",
"value": {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions internal/tlcodegen/test/gen/goldmaster/factory/factory.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6f11136

Please sign in to comment.