test_common

package
v0.39.2 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestDirectory

func TestDirectory(t *testing.T, folderPath string, sourceSuffix string, loadFlowConfig bool, extraArgs []string, convert func(in []byte, extraArgs []string) ([]byte, diag.Diagnostics))

TestDirectory will execute tests for converting from a source configuration file to a flow configuration file for all files in a provided folder path.

For each file in the folderPath which ends with the sourceSuffix:

  1. Execute the convert func on the content of each file.
  2. Remove an Info diags from the results of calling convert in step 1.
  3. If the current filename.sourceSuffix has a matching filename.diags, read the contents of filename.diags and validate that they match in order with the diags from step 2.
  4. If the current filename.sourceSuffix has a matching filename.river, read the contents of filename.river and validate that they match the river configuration generated by calling convert in step 1.

Types

This section is empty.

Jump to

Keyboard shortcuts

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