From 741185b5d5cbd9d120b116b4afc8d5fec10dec86 Mon Sep 17 00:00:00 2001 From: Supun Setunga Date: Thu, 7 Sep 2023 14:27:25 -0700 Subject: [PATCH] Add type generator tests --- .../gen/testdata/composite-type-pragma.cdc | 2 ++ .../testdata/composite-type-pragma.golden.go | 35 +++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 runtime/sema/gen/testdata/composite-type-pragma.cdc create mode 100644 runtime/sema/gen/testdata/composite-type-pragma.golden.go diff --git a/runtime/sema/gen/testdata/composite-type-pragma.cdc b/runtime/sema/gen/testdata/composite-type-pragma.cdc new file mode 100644 index 0000000000..29d2a8dd36 --- /dev/null +++ b/runtime/sema/gen/testdata/composite-type-pragma.cdc @@ -0,0 +1,2 @@ +#compositeType +access(all) struct Test {} diff --git a/runtime/sema/gen/testdata/composite-type-pragma.golden.go b/runtime/sema/gen/testdata/composite-type-pragma.golden.go new file mode 100644 index 0000000000..f975ff112f --- /dev/null +++ b/runtime/sema/gen/testdata/composite-type-pragma.golden.go @@ -0,0 +1,35 @@ +// Code generated from testdata/composite-type-pragma.cdc. DO NOT EDIT. +/* + * Cadence - The resource-oriented smart contract programming language + * + * Copyright Dapper Labs, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package sema + +import "github.com/onflow/cadence/runtime/common" + +const TestTypeName = "Test" + +var TestType = func() *CompositeType { + var t = &CompositeType{ + Identifier: TestTypeName, + Kind: common.CompositeKindStructure, + ImportableBuiltin: false, + HasComputedMembers: true, + } + + return t +}()