Skip to content

Commit

Permalink
add test for invariant
Browse files Browse the repository at this point in the history
  • Loading branch information
Brat-vseznamus committed Oct 29, 2024
1 parent 3f45129 commit 3e0d434
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions internal/tlcodegen/test/codegen_test/goldmaster_invariants_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package codegen

import (
"github.com/stretchr/testify/assert"
"testing"
)
import "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/meta"

func TestFunctionHasUnion(t *testing.T) {
{
fun := meta.FactoryItemByTLName("service5.insertList")
if assert.NotNil(t, fun) {
assert.True(t, fun.IsFunction())
assert.True(t, fun.HasUnionTypesInResult())
}
}
{
fun := meta.FactoryItemByTLName("usefulService.getUserEntity")
if assert.NotNil(t, fun) {
assert.True(t, fun.IsFunction())
assert.True(t, !fun.HasUnionTypesInResult())
}
}
}

0 comments on commit 3e0d434

Please sign in to comment.