package valuestest

import "github.com/influxdata/flux/values/valuestest"

Index

Variables

var ScopeTransformer = cmp.Transformer("Scope", func(s values.Scope) *ComparableScope {
	var sc *ComparableScope = nil
	for {
		if s != nil {
			sc = &ComparableScope{
				Values: make(map[string]values.Value),
				Child:  sc,
			}
			s.LocalRange(func(k string, v values.Value) {
				sc.Values[k] = v
			})
			s = s.Pop()
		} else {
			break
		}
	}
	return sc
})

ScopeTransformer converts a scope to a ComparableScope.

Functions

func Scope

func Scope() values.Scope

Scope returns a scope that contains the prelude.

Types

type ComparableScope

type ComparableScope struct {
	Values map[string]values.Value
	Child  *ComparableScope
}

ComparableScope is a representation of a Scope that is easily compared with the cmp package.

Source Files

scope.go

Version
v0.196.1 (latest)
Published
Feb 19, 2025
Platform
linux/amd64
Imports
3 packages
Last checked
1 day ago

Tools for package owners.