test

package
v0.24.5 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Pairs = []struct {
	Name string
	Test typeinfo.Instance
	Json string
}{{

	"Slice",
	&literal.FieldList{
		Fields: []literal.FieldValue{{
			Field: "first",
			Value: &literal.NumValue{
				Value: 5,
			}}, {
			Field: "second",
			Value: &literal.TextValue{
				Value: "five",
			}},
		},
	}, `{
  "type": "field_list",
  "id": "test-1",
  "extraState": {
    "FIELDS": 2
  },
  "inputs": {
    "FIELDS0": {
      "block": {
        "type": "field_value",
        "id": "test-2",
        "extraState": {
          "FIELD": 1,
          "VALUE": 1
        },
        "fields": {
          "FIELD": "first"
        },
        "inputs": {
          "VALUE": {
            "block": {
              "type": "num_value",
              "id": "test-3",
              "extraState": {
                "VALUE": 1
              },
              "fields": {
                "VALUE": 5
              }
            }
          }
        }
      }
    },
    "FIELDS1": {
      "block": {
        "type": "field_value",
        "id": "test-4",
        "extraState": {
          "FIELD": 1,
          "VALUE": 1
        },
        "fields": {
          "FIELD": "second"
        },
        "inputs": {
          "VALUE": {
            "block": {
              "type": "text_value",
              "id": "test-5",
              "extraState": {
                "VALUE": 1
              },
              "fields": {
                "VALUE": "five"
              }
            }
          }
        }
      }
    }
  }
}`}, {

	"Embed",
	&testdl.TestEmbed{
		TestFlow: testdl.TestFlow{},
	}, `{
  "type": "test_embed",
  "id": "test-1",
  "extraState": {
    "TEST_FLOW": 1
  },
  "inputs": {
    "TEST_FLOW": {
      "block": {
        "type": "test_flow",
        "id": "test-2",
        "extraState": {}
      }
    }
  }
}`}, {

	"Slot",
	&literal.FieldValue{
		Field: "test",
		Value: &literal.NumValue{
			Value: 5,
		}}, `{
  "type": "field_value",
  "id": "test-1",
  "extraState": {
    "FIELD": 1,
    "VALUE": 1
  },
  "fields": {
    "FIELD": "test"
  },
  "inputs": {
    "VALUE": {
      "block": {
        "type": "num_value",
        "id": "test-2",
        "extraState": {
          "VALUE": 1
        },
        "fields": {
          "VALUE": 5
        }
      }
    }
  }
}`}, {

	"Series",
	&testdl.TestFlow{
		Slots: []testdl.TestSlot{
			&testdl.TestFlow{},
			&testdl.TestFlow{},
		}}, `{
  "type": "test_flow",
  "id": "test-1",
  "extraState": {
    "SLOTS": 2
  },
  "inputs": {
    "SLOTS0": {
      "block": {
        "type": "test_flow",
        "id": "test-2",
        "extraState": {}
      }
    },
    "SLOTS1": {
      "block": {
        "type": "test_flow",
        "id": "test-3",
        "extraState": {}
      }
    }
  }
}`}, {

	"FieldDefinition",
	&literal.TextValue{Value: "hello world"}, `{
  "type": "text_value",
  "id": "test-1",
  "extraState": {
    "VALUE": 1
  },
  "fields": {
    "VALUE": "hello world"
  }
}`}, {

	"List",
	&literal.TextValues{
		Values: []string{"a", "b", "c"},
	}, `{
  "type": "text_values",
  "id": "test-1",
  "extraState": {
    "VALUES": 3
  },
  "fields": {
    "VALUES0": "a",
    "VALUES1": "b",
    "VALUES2": "c"
  }
}`}, {

	"Stack",
	&story.StoryFile{
		Statements: []story.StoryStatement{
			&story.StoryBreak{},
			&story.StoryBreak{},
			&story.StoryBreak{},
		}}, `{
  "type": "story_file",
  "id": "test-1",
  "extraState": {
    "STATEMENTS": 3
  },
  "inputs": {
    "STATEMENTS": {
      "block": {
        "type": "_story_break_stack",
        "id": "test-2",
        "extraState": {},
        "next": {
          "block": {
            "type": "_story_break_stack",
            "id": "test-3",
            "extraState": {},
            "next": {
              "block": {
                "type": "_story_break_stack",
                "id": "test-4",
                "extraState": {}
              }
            }
          }
        }
      }
    }
  }
}`}, {

	"EmptySeries",
	&testdl.TestFlow{
		Slots: []testdl.TestSlot{},
	}, `{
  "type": "test_flow",
  "id": "test-1",
  "extraState": {}
}`,
}}

contents of block files and their matching representation in go. ( used by un/block to test read/writing of block files )

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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