Documentation ¶
Overview ¶
Package testmtx helps you to create test data files with Google Spreadsheets. Once you create test cases as matrix on Google Spreadsheets, this tool generates test data like JSON based on the data you input. Using testmtx, you can get advantages of `completeness`, `readability` and `consistency` for testing.
This package is just liblary. If what you want is just to use, see the standard tool below which uses this package. - github.com/takuoki/testmtx/tools/testmtx
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Formatter ¶
type Formatter interface {
// contains filtered or unexported methods
}
Formatter is an interface for formatting. This interface has private methods, so cannot create an original formatter outside of this package.
type JSONFormatOption ¶
type JSONFormatOption func(*JSONFormatter) error
JSONFormatOption changes some parameters of the JSONFormatter.
func JSONIndentStr ¶
func JSONIndentStr(s string) JSONFormatOption
JSONIndentStr changes the indent string in JSON file.
type JSONFormatter ¶
type JSONFormatter struct {
// contains filtered or unexported fields
}
JSONFormatter is a struct to format the sheet object as JSON. Create it using NewJSONFormatter function.
func NewJSONFormatter ¶
func NewJSONFormatter(options ...JSONFormatOption) (*JSONFormatter, error)
NewJSONFormatter creates a new JSONFormatter. You can change some parameters of the JSONFormatter with JSONFormatOption.
type ParseOption ¶
ParseOption changes some parameters of the Parser.
func PropLevel ¶
func PropLevel(level int) ParseOption
PropLevel changes the property level on the spreadsheet.
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser is a struct to parse the sheet values to the sheet object. Create it using NewParser function.
func NewParser ¶
func NewParser(options ...ParseOption) (*Parser, error)
NewParser creates a new Parser. You can change some parameters of the Parser with ParseOption.
type PropGenOption ¶
type PropGenOption func(*PropGenerator) error
PropGenOption changes some parameters of the PropGenerator.
func GenWriter ¶
func GenWriter(w io.Writer) PropGenOption
GenWriter changes the writer of the PropGenerator.
func PropLevel4Gen ¶
func PropLevel4Gen(level int) PropGenOption
PropLevel4Gen changes the property level on the spreadsheet.
func RepeatCount ¶
func RepeatCount(c int) PropGenOption
RepeatCount changes the repeat count of the array properties.
type PropGenerator ¶
type PropGenerator struct {
// contains filtered or unexported fields
}
PropGenerator is a struct to generate a property list with Go type. Create it using NewPropGenerator function.
func NewPropGenerator ¶
func NewPropGenerator(options ...PropGenOption) (*PropGenerator, error)
NewPropGenerator creates a new PropGenerator. You can change some parameters of the PropGenerator with PropGenOption.
func (*PropGenerator) Generate ¶
func (g *PropGenerator) Generate(file, tName string) error
Generate is a method to generate a property list with Go type.
func (*PropGenerator) GenerateDir ¶ added in v1.1.0
func (g *PropGenerator) GenerateDir(path, tName string) error
GenerateDir is a method to generate a property list with Go type.
type Sheet ¶
type Sheet struct {
// contains filtered or unexported fields
}
Sheet is a parsed sheet which matches testmtx format.
type YamlFormatOption ¶
type YamlFormatOption func(*YamlFormatter) error
YamlFormatOption changes some parameters of the YamlFormatter.
func YamlIndentStr ¶
func YamlIndentStr(s string) YamlFormatOption
YamlIndentStr changes the indent string in Yaml file.
type YamlFormatter ¶
type YamlFormatter struct {
// contains filtered or unexported fields
}
YamlFormatter is a struct to format the sheet object as YAML. Create it using NewYamlFormatter function.
func NewYamlFormatter ¶
func NewYamlFormatter(options ...YamlFormatOption) (*YamlFormatter, error)
NewYamlFormatter creates a new YamlFormatter. You can change some parameters of the YamlFormatter with YamlFormatOption.