variablecard

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

* Copyright 2022 ByteDance 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.

* Copyright 2022 ByteDance 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.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicPtrReNameToString

func BasicPtrReNameToString(ctx context.Context, t reflect.Type, v reflect.Value, typeName string) string

func BasicPtrToString

func BasicPtrToString(ctx context.Context, t reflect.Type, v reflect.Value) string

func MapElementToString

func MapElementToString(ctx context.Context, v reflect.Value) string

func NewFunctionParam

func NewFunctionParam(t reflect.Type) reflect.Value

func ParameterToString

func ParameterToString(ctx context.Context, t reflect.Type, v reflect.Value) string

ParameterToString we need record basic value Corpus

func SafeSet

func SafeSet(f reflect.Value, ctx context.Context, found bool, fake interface{})

func SliceElementToString

func SliceElementToString(ctx context.Context, v reflect.Value) string

func StructFieldToString

func StructFieldToString(ctx context.Context, v reflect.Value) string

TODO: use the json to do the transform

func ValueToString

func ValueToString(ctx context.Context, v reflect.Value) (code string)

value refers to the reflect value But some times it might refers to the mocksRecord.

func VariableMutate

func VariableMutate(ctx context.Context, t reflect.Type, v reflect.Value) (mutate reflect.Value)

the context contains the follow information: canBeNil: Bool. If the variable is used for the mocked statement input, it could be nil. ID: ID tell us the relationship between the variable and statement. Level: determine how deeply that we do the recursion.

Types

type InputVariadic

type InputVariadic struct {
	IsVariadic      bool
	IsVariadicParam bool
}

type MocksRecord

type MocksRecord []string

type MonkeyOutputMap

type MonkeyOutputMap map[string]string //key:functionName value is function return string

type SpecialValue

type SpecialValue interface {
	ValueToCode() string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL