diff --git a/.credo.exs b/.credo.exs new file mode 100644 index 0000000..7a70b1a --- /dev/null +++ b/.credo.exs @@ -0,0 +1,225 @@ +# This file contains the configuration for Credo and you are probably reading +# this after creating it with `mix credo.gen.config`. +# +# If you find anything wrong or unclear in this file, please report an +# issue on GitHub: https://github.com/rrrene/credo/issues +# +%{ + # + # You can have as many configs as you like in the `configs:` field. + configs: [ + %{ + # + # Run any config using `mix credo -C `. If no config name is given + # "default" is used. + # + name: "default", + # + # These are the files included in the analysis: + files: %{ + # + # You can give explicit globs or simply directories. + # In the latter case `**/*.{ex,exs}` will be used. + # + included: [ + "lib/", + "src/", + "test/", + "web/", + "apps/*/lib/", + "apps/*/src/", + "apps/*/test/", + "apps/*/web/" + ], + excluded: [~r"/_build/", ~r"/deps/", ~r"/node_modules/"] + }, + # + # Load and configure plugins here: + # + plugins: [], + # + # If you create your own checks, you must specify the source files for + # them here, so they can be loaded by Credo before running the analysis. + # + requires: [], + # + # If you want to enforce a style guide and need a more traditional linting + # experience, you can change `strict` to `true` below: + # + strict: false, + # + # To modify the timeout for parsing files, change this value: + # + parse_timeout: 5000, + # + # If you want to use uncolored output by default, you can change `color` + # to `false` below: + # + color: true, + # + # You can customize the parameters of any check by adding a second element + # to the tuple. + # + # To disable a check put `false` as second element: + # + # {Credo.Check.Design.DuplicatedCode, false} + # + checks: %{ + enabled: [ + # + ## Consistency Checks + # + {Credo.Check.Consistency.ExceptionNames, []}, + {Credo.Check.Consistency.LineEndings, []}, + {Credo.Check.Consistency.ParameterPatternMatching, []}, + {Credo.Check.Consistency.SpaceAroundOperators, []}, + {Credo.Check.Consistency.SpaceInParentheses, []}, + {Credo.Check.Consistency.TabsOrSpaces, []}, + + # + ## Design Checks + # + # You can customize the priority of any check + # Priority values are: `low, normal, high, higher` + # + {Credo.Check.Design.AliasUsage, + [priority: :low, if_nested_deeper_than: 2, if_called_more_often_than: 0]}, + {Credo.Check.Design.TagFIXME, []}, + # You can also customize the exit_status of each check. + # If you don't want TODO comments to cause `mix credo` to fail, just + # set this value to 0 (zero). + # + {Credo.Check.Design.TagTODO, [exit_status: 2]}, + + # + ## Readability Checks + # + {Credo.Check.Readability.AliasOrder, []}, + {Credo.Check.Readability.FunctionNames, []}, + {Credo.Check.Readability.LargeNumbers, []}, + {Credo.Check.Readability.MaxLineLength, [priority: :low, max_length: 120]}, + {Credo.Check.Readability.ModuleAttributeNames, []}, + {Credo.Check.Readability.ModuleDoc, []}, + {Credo.Check.Readability.ModuleNames, []}, + {Credo.Check.Readability.ParenthesesInCondition, []}, + {Credo.Check.Readability.ParenthesesOnZeroArityDefs, []}, + {Credo.Check.Readability.PipeIntoAnonymousFunctions, []}, + {Credo.Check.Readability.PredicateFunctionNames, []}, + {Credo.Check.Readability.PreferImplicitTry, []}, + {Credo.Check.Readability.RedundantBlankLines, []}, + {Credo.Check.Readability.Semicolons, []}, + {Credo.Check.Readability.SpaceAfterCommas, []}, + {Credo.Check.Readability.StringSigils, []}, + {Credo.Check.Readability.TrailingBlankLine, []}, + {Credo.Check.Readability.TrailingWhiteSpace, []}, + {Credo.Check.Readability.UnnecessaryAliasExpansion, []}, + {Credo.Check.Readability.VariableNames, []}, + {Credo.Check.Readability.WithSingleClause, []}, + + # + ## Refactoring Opportunities + # + {Credo.Check.Refactor.Apply, []}, + {Credo.Check.Refactor.CondStatements, []}, + {Credo.Check.Refactor.CyclomaticComplexity, []}, + {Credo.Check.Refactor.FilterCount, []}, + {Credo.Check.Refactor.FilterFilter, []}, + {Credo.Check.Refactor.FunctionArity, []}, + {Credo.Check.Refactor.LongQuoteBlocks, []}, + {Credo.Check.Refactor.MapJoin, []}, + {Credo.Check.Refactor.MatchInCondition, []}, + {Credo.Check.Refactor.NegatedConditionsInUnless, []}, + {Credo.Check.Refactor.NegatedConditionsWithElse, []}, + {Credo.Check.Refactor.Nesting, []}, + {Credo.Check.Refactor.RedundantWithClauseResult, []}, + {Credo.Check.Refactor.RejectReject, []}, + {Credo.Check.Refactor.UnlessWithElse, []}, + {Credo.Check.Refactor.WithClauses, []}, + + # + ## Warnings + # + {Credo.Check.Warning.ApplicationConfigInModuleAttribute, []}, + {Credo.Check.Warning.BoolOperationOnSameValues, []}, + {Credo.Check.Warning.Dbg, []}, + {Credo.Check.Warning.ExpensiveEmptyEnumCheck, []}, + {Credo.Check.Warning.IExPry, []}, + {Credo.Check.Warning.IoInspect, []}, + {Credo.Check.Warning.MissedMetadataKeyInLoggerConfig, []}, + {Credo.Check.Warning.OperationOnSameValues, []}, + {Credo.Check.Warning.OperationWithConstantResult, []}, + {Credo.Check.Warning.RaiseInsideRescue, []}, + {Credo.Check.Warning.SpecWithStruct, []}, + {Credo.Check.Warning.UnsafeExec, []}, + {Credo.Check.Warning.UnusedEnumOperation, []}, + {Credo.Check.Warning.UnusedFileOperation, []}, + {Credo.Check.Warning.UnusedKeywordOperation, []}, + {Credo.Check.Warning.UnusedListOperation, []}, + {Credo.Check.Warning.UnusedPathOperation, []}, + {Credo.Check.Warning.UnusedRegexOperation, []}, + {Credo.Check.Warning.UnusedStringOperation, []}, + {Credo.Check.Warning.UnusedTupleOperation, []}, + {Credo.Check.Warning.WrongTestFileExtension, []}, + + # Enabled controversial and experimental checks + {Credo.Check.Consistency.UnusedVariableNames, []}, + {Credo.Check.Readability.ImplTrue, []}, + {Credo.Check.Readability.Specs, []}, + {Credo.Check.Readability.StrictModuleLayout, []}, + {Credo.Check.Refactor.IoPuts, []}, + {Credo.Check.Warning.MixEnv, []} + ], + disabled: [ + # + # Checks scheduled for next check update (opt-in for now) + {Credo.Check.Refactor.UtcNowTruncate, []}, + + # + # Controversial and experimental checks (opt-in, just move the check to `:enabled` + # and be sure to use `mix credo --strict` to see low priority checks) + # + {Credo.Check.Consistency.MultiAliasImportRequireUse, []}, + # {Credo.Check.Consistency.UnusedVariableNames, []}, + {Credo.Check.Design.DuplicatedCode, []}, + {Credo.Check.Design.SkipTestWithoutComment, []}, + {Credo.Check.Readability.AliasAs, []}, + {Credo.Check.Readability.BlockPipe, []}, + # {Credo.Check.Readability.ImplTrue, []}, + {Credo.Check.Readability.MultiAlias, []}, + {Credo.Check.Readability.NestedFunctionCalls, []}, + {Credo.Check.Readability.OneArityFunctionInPipe, []}, + {Credo.Check.Readability.OnePipePerLine, []}, + {Credo.Check.Readability.SeparateAliasRequire, []}, + {Credo.Check.Readability.SingleFunctionToBlockPipe, []}, + {Credo.Check.Readability.SinglePipe, []}, + # {Credo.Check.Readability.Specs, []}, + # {Credo.Check.Readability.StrictModuleLayout, []}, + {Credo.Check.Readability.WithCustomTaggedTuple, []}, + {Credo.Check.Refactor.ABCSize, []}, + {Credo.Check.Refactor.AppendSingleItem, []}, + {Credo.Check.Refactor.DoubleBooleanNegation, []}, + {Credo.Check.Refactor.FilterReject, []}, + # {Credo.Check.Refactor.IoPuts, []}, + {Credo.Check.Refactor.MapMap, []}, + {Credo.Check.Refactor.ModuleDependencies, []}, + {Credo.Check.Refactor.NegatedIsNil, []}, + {Credo.Check.Refactor.PassAsyncInTestCases, []}, + {Credo.Check.Refactor.PipeChainStart, []}, + {Credo.Check.Refactor.RejectFilter, []}, + {Credo.Check.Refactor.VariableRebinding, []}, + {Credo.Check.Warning.LazyLogging, []}, + {Credo.Check.Warning.LeakyEnvironment, []}, + {Credo.Check.Warning.MapGetUnsafePass, []}, + # {Credo.Check.Warning.MixEnv, []}, + {Credo.Check.Warning.UnsafeToAtom, []} + + # {Credo.Check.Refactor.MapInto, []}, + + # + # Custom checks can be created using `mix credo.gen.check`. + # + ] + } + } + ] +} diff --git a/.formatter.exs b/.formatter.exs new file mode 100644 index 0000000..d2cda26 --- /dev/null +++ b/.formatter.exs @@ -0,0 +1,4 @@ +# Used by "mix format" +[ + inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"] +] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..fedd31a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,243 @@ +name: CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +env: + MIX_ENV: test + +jobs: + compile: + name: Compilation + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Elixir + uses: erlef/setup-beam@v1 + with: + elixir-version: '1.18.3' + otp-version: '27.3' + + - name: Cache deps + uses: actions/cache@v4 + with: + path: | + deps + _build + key: deps-${{ runner.os }}-27.3-1.18.3-${{ hashFiles('**/mix.lock') }} + restore-keys: | + deps-${{ runner.os }}-27.3-1.18.3- + + - name: Install dependencies + run: mix deps.get + + - name: Compile dependencies + run: mix deps.compile + + - name: Compile project with warnings as errors + run: mix compile --warnings-as-errors + + format: + name: Code Formatting + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Elixir + uses: erlef/setup-beam@v1 + with: + elixir-version: '1.18.3' + otp-version: '27.3' + + - name: Check formatting + run: mix format --check-formatted + + test: + name: Test (Elixir ${{matrix.elixir}} / OTP ${{matrix.otp}}) + runs-on: ubuntu-latest + needs: [format, compile] + + strategy: + fail-fast: false + matrix: + include: + # Latest stable versions + - elixir: '1.18.3' + otp: '27.3' + coverage: true + # Previous versions for compatibility + - elixir: '1.17.3' + otp: '26.2' + coverage: false + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Elixir + uses: erlef/setup-beam@v1 + with: + elixir-version: ${{ matrix.elixir }} + otp-version: ${{ matrix.otp }} + + - name: Cache deps + uses: actions/cache@v4 + with: + path: | + deps + _build + key: deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }} + restore-keys: | + deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}- + + - name: Install dependencies + run: mix deps.get + + - name: Compile dependencies + run: mix deps.compile + + - name: Compile project + run: mix compile + + - name: Run tests with coverage + if: ${{ matrix.coverage }} + run: mix coveralls.json + + - name: Upload coverage to Codecov + if: ${{ matrix.coverage }} + uses: codecov/codecov-action@v4 + with: + file: ./cover/excoveralls.json + fail_ci_if_error: false + token: ${{ secrets.CODECOV_TOKEN }} + + - name: Run tests + if: ${{ !matrix.coverage }} + run: mix test + + credo: + name: Static Code Analysis (Credo) + runs-on: ubuntu-latest + needs: compile + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Elixir + uses: erlef/setup-beam@v1 + with: + elixir-version: '1.18.3' + otp-version: '27.3' + + - name: Cache deps + uses: actions/cache@v4 + with: + path: | + deps + _build + key: deps-${{ runner.os }}-27.3-1.18.3-${{ hashFiles('**/mix.lock') }} + restore-keys: | + deps-${{ runner.os }}-27.3-1.18.3- + + - name: Install dependencies + run: mix deps.get + + - name: Compile dependencies + run: mix deps.compile + + - name: Compile project + run: mix compile + + - name: Run Credo + run: mix credo --strict + + dialyzer: + name: Static Type Analysis (Dialyzer) + runs-on: ubuntu-latest + needs: compile + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Elixir + uses: erlef/setup-beam@v1 + with: + elixir-version: '1.18.3' + otp-version: '27.3' + + - name: Cache deps + uses: actions/cache@v4 + with: + path: | + deps + _build + key: deps-${{ runner.os }}-27.3-1.18.3-${{ hashFiles('**/mix.lock') }} + restore-keys: | + deps-${{ runner.os }}-27.3-1.18.3- + + - name: Cache Dialyzer PLTs + uses: actions/cache@v4 + with: + path: priv/plts + key: dialyzer-${{ runner.os }}-27.3-1.18.3-${{ hashFiles('**/mix.lock') }} + restore-keys: | + dialyzer-${{ runner.os }}-27.3-1.18.3- + + - name: Install dependencies + run: mix deps.get + + - name: Compile dependencies + run: mix deps.compile + + - name: Compile project + run: mix compile + + - name: Run Dialyzer + run: mix dialyzer + + scion-tests: + name: SCION Test Suite + runs-on: ubuntu-latest + needs: test + continue-on-error: true + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Elixir + uses: erlef/setup-beam@v1 + with: + elixir-version: '1.18.3' + otp-version: '27.3' + + - name: Cache deps + uses: actions/cache@v4 + with: + path: | + deps + _build + key: deps-${{ runner.os }}-27.3-1.18.3-${{ hashFiles('**/mix.lock') }} + restore-keys: | + deps-${{ runner.os }}-27.3-1.18.3- + + - name: Run SCION basic tests + run: mix test --include spec:basic + + - name: Upload SCION test results + uses: actions/upload-artifact@v4 + if: always() + with: + name: scion-test-results + path: _build/test/lib/sc/test-results.xml + retention-days: 30 diff --git a/.gitignore b/.gitignore index 5efb632..1464ce4 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,9 @@ sc-*.tar # Temporary files, for example, from tests. /tmp/ + +# Dialyzer PLT files +/priv/plts/ + +# Keep granted permissions local to the person +.claude diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..72e8b96 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,207 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Commands + +**Code Verification Workflow:** +When verifying code changes, always follow this sequence: +1. `mix format` - Auto-fix formatting issues (trailing whitespace, final newlines, etc.) +2. `mix coveralls` - Ensure functionality and maintain at least 90% test coverage +3. `mix credo --strict` - Run static code analysis only after tests pass +4. `mix dialyzer` - Run Dialyzer static analysis for type checking + +**Testing:** +- `mix coveralls` - Run all tests with coverage reporting (ensure at least 90% coverage) +- `mix coveralls.detail` - Run tests with detailed coverage report showing uncovered lines +- `mix test` - Run all tests without coverage +- `mix test test/sc/location_test.exs` - Run location tracking tests +- `mix test test/sc/parser/scxml_test.exs` - Run specific SCXML parser tests + +**Development:** +- `mix deps.get` - Install dependencies +- `mix compile` - Compile the project +- `mix docs` - Generate documentation +- `mix format` - Format code according to Elixir standards (run first for code verification) +- `mix format --check-formatted` - Check if code is properly formatted +- `mix credo --strict` - Run static code analysis with strict mode (run after tests pass) +- `mix dialyzer` - Run Dialyzer for static type analysis (run last in verification workflow) + +## Architecture + +This is an Elixir implementation of SCXML (State Chart XML) state machines with a focus on W3C compliance. + +The State Chart reference XML is here: https://www.w3.org/TR/scxml/ + +This project uses Elixir Structs for the data structures, and MapSets for sets. + +Also use this initial Elixir implementation as reference: https://github.com/camshaft/ex_statechart + +## Core Components + +### Data Structures +- **`SC.Document`** - Root SCXML document structure with attributes like `name`, `initial`, `datamodel`, `version`, `xmlns`, plus collections of `states` and `datamodel_elements` +- **`SC.State`** - Individual state with `id`, optional `initial` state, nested `states` list, and `transitions` list +- **`SC.Transition`** - State transitions with optional `event`, `target`, and `cond` attributes +- **`SC.DataElement`** - Datamodel elements with required `id` and optional `expr` and `src` attributes + +### Parsers +- **`SC.Parser.SCXML`** - Main SCXML parser using Saxy SAX parser for accurate location tracking + - Parses XML strings into `SC.Document` structs with precise source location information + - Event-driven SAX parsing for better memory efficiency and location tracking + - Handles namespace declarations and XML attributes correctly + - Supports nested states and hierarchical structures + - Converts empty XML attributes to `nil` for cleaner data representation + - Returns `{:ok, document}` or `{:error, reason}` tuples +- **`SC.Parser.SCXML.Handler`** - SAX event handler for SCXML parsing + - Implements `Saxy.Handler` behavior for processing XML events + - Tracks element occurrences and position information during parsing + - Manages element stack for proper hierarchical document construction +- **`SC.Parser.SCXML.ElementBuilder`** - Builds SCXML elements from SAX events +- **`SC.Parser.SCXML.LocationTracker`** - Tracks precise source locations for elements and attributes +- **`SC.Parser.SCXML.StateStack`** - Manages parsing state stack for hierarchical document construction + +### Interpreter and Runtime +- **`SC.Interpreter`** - Core SCXML interpreter with synchronous API + - Initializes state charts from validated documents + - Processes events and manages state transitions + - Returns active state configurations + - Provides `{:ok, result}` or `{:error, reason}` responses +- **`SC.StateChart`** - Runtime container for SCXML state machines + - Combines document, configuration, and event queues + - Maintains internal and external event queues per SCXML specification +- **`SC.Configuration`** - Active state configuration management + - Stores only leaf states for efficient memory usage + - Computes ancestor states dynamically from document hierarchy + - Uses MapSets for fast state membership testing +- **`SC.Event`** - Event representation with internal/external origins + - Supports event data and origin tracking + - Used for state machine event processing +- **`SC.Document.Validator`** - Document validation and consistency checking + - Validates structural correctness and semantic consistency + - Includes finalize callback for whole-document validations + - Catches issues like invalid references, unreachable states, malformed hierarchies + +### Test Infrastructure +- **`SC.Case`** - Test case template module for SCXML testing + - Provides `test_scxml/4` function for testing state machine behavior + - Uses SC.Interpreter for document initialization and event processing + - Supports initial configuration verification and event sequence testing + - Used by both SCION and W3C test suites + +### Location Tracking +All parsed SCXML elements include precise source location information for validation error reporting: + +- **Element locations**: Each parsed element (`SC.Document`, `SC.State`, `SC.Transition`, `SC.DataElement`) includes a `source_location` field with line/column information +- **Attribute locations**: Individual attributes have dedicated location fields (e.g., `name_location`, `id_location`, `event_location`) for precise error reporting +- **Multiline support**: Accurately tracks locations for both single-line and multiline XML element definitions +- **SAX-based tracking**: Uses Saxy's event-driven parsing to maintain position information throughout the parsing process + +## Dependencies + +- **`saxy`** (~> 1.6) - Fast, memory-efficient SAX XML parser with position tracking support + +## Development Dependencies + +- **`credo`** (~> 1.7) - Static code analysis tool for code quality and consistency +- **`dialyxir`** (~> 1.4) - Dialyzer wrapper for static type analysis and error detection + +## Tests + +This project includes comprehensive test coverage: + +### SCION Test Suite (`test/scion_tests/`) +- 127+ test files from the SCION project +- Module naming: `SCIONTest.Category.TestNameTest` (e.g., `SCIONTest.ActionSend.Send1Test`) +- Uses `SC.Case` for test infrastructure +- Tests cover basic state machines, transitions, parallel states, history, etc. + +### W3C SCXML Test Suite (`test/scxml_tests/`) +- 59+ test files from W3C SCXML conformance tests +- Module naming: `Test.StateChart.W3.Category.TestName` (e.g., `Test.StateChart.W3.Events.Test396`) +- Uses `SC.Case` for test infrastructure +- Organized by SCXML specification sections (mandatory tests) + +### Parser Tests (`test/sc/parser/scxml_test.exs`) +- Unit tests for `SC.Parser.SCXML` +- Tests parsing of simple documents, transitions, datamodels, nested states +- Validates error handling for invalid XML +- Ensures proper attribute handling (nil for empty values) + +### Location Tracking Tests (`test/sc/location_test.exs`) +- Tests for precise source location tracking in SCXML documents +- Validates line number accuracy for elements and attributes +- Tests both single-line and multiline XML element definitions +- Ensures proper location tracking for nested elements and datamodel elements + +## Code Style + +- All generated files have no trailing whitespace +- Code is formatted using `mix format` +- Static code analysis with `mix credo --strict` - all issues resolved +- Type specs (`@spec`) are provided for all public functions +- Comprehensive documentation with `@moduledoc` and `@doc` +- Consistent naming for unused variables (meaningful names with `_` prefix) + +## XML Format + +Test files use triple-quote multiline strings for XML content: + +```elixir +xml = """ + + + + +""" +``` + +XML content within triple quotes uses 4-space base indentation. + +## SCION Test Results + +**Current Status:** 107/225 tests passing (47.6% pass rate) + +**Working Features:** +- ✅ Basic state transitions (basic1, basic2 tests pass) +- ✅ Simple hierarchical states +- ✅ Event-driven state changes +- ✅ Initial state configuration +- ✅ Document validation and error reporting + +**Main Failure Categories:** +- **Document parsing failures**: Complex SCXML with parallel states, history states, executable content +- **Validation too strict**: Rejecting valid but complex SCXML documents +- **Missing SCXML features**: Parallel states, conditional transitions, targetless transitions, internal transitions +- **Missing executable content**: ` + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [{%{"name" => "t"}, ["c"]}]) + end +end diff --git a/test/scion_tests/assign-current-small-step/test1_test.exs b/test/scion_tests/assign-current-small-step/test1_test.exs new file mode 100644 index 0000000..28381a9 --- /dev/null +++ b/test/scion_tests/assign-current-small-step/test1_test.exs @@ -0,0 +1,55 @@ +defmodule SCIONTest.AssignCurrentSmallStep.Test1Test do + use SC.Case + @tag :scion + @tag spec: "assign_current_small_step" + test "test1" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [{%{"name" => "t"}, ["c"]}]) + end +end diff --git a/test/scion_tests/assign-current-small-step/test2_test.exs b/test/scion_tests/assign-current-small-step/test2_test.exs new file mode 100644 index 0000000..39cbede --- /dev/null +++ b/test/scion_tests/assign-current-small-step/test2_test.exs @@ -0,0 +1,75 @@ +defmodule SCIONTest.AssignCurrentSmallStep.Test2Test do + use SC.Case + @tag :scion + @tag spec: "assign_current_small_step" + test "test2" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [{%{"name" => "t"}, ["e"]}]) + end +end diff --git a/test/scion_tests/assign-current-small-step/test3_test.exs b/test/scion_tests/assign-current-small-step/test3_test.exs new file mode 100644 index 0000000..e28ed7f --- /dev/null +++ b/test/scion_tests/assign-current-small-step/test3_test.exs @@ -0,0 +1,83 @@ +defmodule SCIONTest.AssignCurrentSmallStep.Test3Test do + use SC.Case + @tag :scion + @tag spec: "assign_current_small_step" + test "test3" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [ + {%{"name" => "t1"}, ["b1", "c1"]}, + {%{"name" => "t2"}, ["b2", "c2"]}, + {%{"name" => "t3"}, ["d"]} + ]) + end +end diff --git a/test/scion_tests/assign-current-small-step/test4_test.exs b/test/scion_tests/assign-current-small-step/test4_test.exs new file mode 100644 index 0000000..7ced1ef --- /dev/null +++ b/test/scion_tests/assign-current-small-step/test4_test.exs @@ -0,0 +1,73 @@ +defmodule SCIONTest.AssignCurrentSmallStep.Test4Test do + use SC.Case + @tag :scion + @tag spec: "assign_current_small_step" + test "test4" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [{%{"name" => "t"}, ["c"]}]) + end +end diff --git a/test/scion_tests/assign/assign_invalid_test.exs b/test/scion_tests/assign/assign_invalid_test.exs new file mode 100644 index 0000000..2927e44 --- /dev/null +++ b/test/scion_tests/assign/assign_invalid_test.exs @@ -0,0 +1,47 @@ +defmodule SCIONTest.Assign.AssignInvalidTest do + use SC.Case + @tag :scion + @tag spec: "assign" + test "assign_invalid" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["pass"], []) + end +end diff --git a/test/scion_tests/assign/assign_obj_literal_test.exs b/test/scion_tests/assign/assign_obj_literal_test.exs new file mode 100644 index 0000000..0b603fe --- /dev/null +++ b/test/scion_tests/assign/assign_obj_literal_test.exs @@ -0,0 +1,46 @@ +defmodule SCIONTest.Assign.AssignObjLiteralTest do + use SC.Case + @tag :scion + @tag spec: "assign" + test "assign_obj_literal" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["s1"], [{%{"name" => "pass"}, ["pass"]}]) + end +end diff --git a/test/scion_tests/atom3-basic-tests/m0_test.exs b/test/scion_tests/atom3-basic-tests/m0_test.exs new file mode 100644 index 0000000..c1617f9 --- /dev/null +++ b/test/scion_tests/atom3-basic-tests/m0_test.exs @@ -0,0 +1,29 @@ +defmodule SCIONTest.Atom3BasicTests.M0Test do + use SC.Case + @tag :scion + @tag spec: "atom3_basic_tests" + test "m0" do + xml = """ + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["A"], [{%{"name" => "e1"}, ["B"]}, {%{"name" => "e2"}, ["A"]}]) + end +end diff --git a/test/scion_tests/atom3-basic-tests/m1_test.exs b/test/scion_tests/atom3-basic-tests/m1_test.exs new file mode 100644 index 0000000..89b9d97 --- /dev/null +++ b/test/scion_tests/atom3-basic-tests/m1_test.exs @@ -0,0 +1,31 @@ +defmodule SCIONTest.Atom3BasicTests.M1Test do + use SC.Case + @tag :scion + @tag spec: "atom3_basic_tests" + test "m1" do + xml = """ + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["A"], [{%{"name" => "e1"}, ["B"]}, {%{"name" => "e2"}, ["A"]}]) + end +end diff --git a/test/scion_tests/atom3-basic-tests/m2_test.exs b/test/scion_tests/atom3-basic-tests/m2_test.exs new file mode 100644 index 0000000..66cad05 --- /dev/null +++ b/test/scion_tests/atom3-basic-tests/m2_test.exs @@ -0,0 +1,36 @@ +defmodule SCIONTest.Atom3BasicTests.M2Test do + use SC.Case + @tag :scion + @tag spec: "atom3_basic_tests" + test "m2" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["A"], [{%{"name" => "e1"}, ["B"]}, {%{"name" => "e2"}, ["A"]}]) + end +end diff --git a/test/scion_tests/atom3-basic-tests/m3_test.exs b/test/scion_tests/atom3-basic-tests/m3_test.exs new file mode 100644 index 0000000..cc257da --- /dev/null +++ b/test/scion_tests/atom3-basic-tests/m3_test.exs @@ -0,0 +1,50 @@ +defmodule SCIONTest.Atom3BasicTests.M3Test do + use SC.Case + @tag :scion + @tag spec: "atom3_basic_tests" + test "m3" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["A"], [ + {%{"name" => "e1"}, ["B"]}, + {%{"name" => "e2"}, ["A"]}, + {%{"name" => "e1"}, ["B"]}, + {%{"name" => "e1"}, ["C"]} + ]) + end +end diff --git a/test/scion_tests/basic/basic0_test.exs b/test/scion_tests/basic/basic0_test.exs new file mode 100644 index 0000000..429904e --- /dev/null +++ b/test/scion_tests/basic/basic0_test.exs @@ -0,0 +1,36 @@ +defmodule SCIONTest.Basic.Basic0Test do + use SC.Case + @tag :scion + @tag spec: "basic" + test "basic0" do + xml = """ + + + + + + + + """ + + test_scxml(xml, "", ["a"], []) + end +end diff --git a/test/scion_tests/basic/basic1_test.exs b/test/scion_tests/basic/basic1_test.exs new file mode 100644 index 0000000..6d24c4b --- /dev/null +++ b/test/scion_tests/basic/basic1_test.exs @@ -0,0 +1,39 @@ +defmodule SCIONTest.Basic.Basic1Test do + use SC.Case + @tag :scion + @tag spec: "basic" + test "basic1" do + xml = """ + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [{%{"name" => "t"}, ["b"]}]) + end +end diff --git a/test/scion_tests/basic/basic2_test.exs b/test/scion_tests/basic/basic2_test.exs new file mode 100644 index 0000000..99ee9c5 --- /dev/null +++ b/test/scion_tests/basic/basic2_test.exs @@ -0,0 +1,42 @@ +defmodule SCIONTest.Basic.Basic2Test do + use SC.Case + @tag :scion + @tag spec: "basic" + test "basic2" do + xml = """ + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [{%{"name" => "t"}, ["b"]}, {%{"name" => "t2"}, ["c"]}]) + end +end diff --git a/test/scion_tests/cond-js/TestConditionalTransition_test.exs b/test/scion_tests/cond-js/TestConditionalTransition_test.exs new file mode 100644 index 0000000..81cae8b --- /dev/null +++ b/test/scion_tests/cond-js/TestConditionalTransition_test.exs @@ -0,0 +1,115 @@ +defmodule SCIONTest.CondJs.TestConditionalTransitionTest do + use SC.Case + @tag :scion + @tag spec: "cond_js" + test "TestConditionalTransition" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["b"], [ + {%{"name" => "t1"}, ["d1"]}, + {%{"name" => "t2"}, ["e1"]}, + {%{"name" => "t3"}, ["f2"]}, + {%{"name" => "t4"}, ["h"]}, + {%{"name" => "t5"}, ["i"]}, + {%{"name" => "t5"}, ["last"]} + ]) + end +end diff --git a/test/scion_tests/cond-js/test0_test.exs b/test/scion_tests/cond-js/test0_test.exs new file mode 100644 index 0000000..65fd3f9 --- /dev/null +++ b/test/scion_tests/cond-js/test0_test.exs @@ -0,0 +1,39 @@ +defmodule SCIONTest.CondJs.Test0Test do + use SC.Case + @tag :scion + @tag spec: "cond_js" + test "test0" do + xml = """ + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [{%{"name" => "t"}, ["b"]}]) + end +end diff --git a/test/scion_tests/cond-js/test1_test.exs b/test/scion_tests/cond-js/test1_test.exs new file mode 100644 index 0000000..1c25c4a --- /dev/null +++ b/test/scion_tests/cond-js/test1_test.exs @@ -0,0 +1,42 @@ +defmodule SCIONTest.CondJs.Test1Test do + use SC.Case + @tag :scion + @tag spec: "cond_js" + test "test1" do + xml = """ + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [{%{"name" => "t"}, ["b"]}]) + end +end diff --git a/test/scion_tests/cond-js/test2_test.exs b/test/scion_tests/cond-js/test2_test.exs new file mode 100644 index 0000000..8a522d9 --- /dev/null +++ b/test/scion_tests/cond-js/test2_test.exs @@ -0,0 +1,39 @@ +defmodule SCIONTest.CondJs.Test2Test do + use SC.Case + @tag :scion + @tag spec: "cond_js" + test "test2" do + xml = """ + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [{%{"name" => "t"}, ["b"]}]) + end +end diff --git a/test/scion_tests/data/data_invalid_test.exs b/test/scion_tests/data/data_invalid_test.exs new file mode 100644 index 0000000..5403c2e --- /dev/null +++ b/test/scion_tests/data/data_invalid_test.exs @@ -0,0 +1,46 @@ +defmodule SCIONTest.Data.DataInvalidTest do + use SC.Case + @tag :scion + @tag spec: "data" + test "data_invalid" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["pass"], []) + end +end diff --git a/test/scion_tests/data/data_obj_literal_test.exs b/test/scion_tests/data/data_obj_literal_test.exs new file mode 100644 index 0000000..df9d223 --- /dev/null +++ b/test/scion_tests/data/data_obj_literal_test.exs @@ -0,0 +1,45 @@ +defmodule SCIONTest.Data.DataObjLiteralTest do + use SC.Case + @tag :scion + @tag spec: "data" + test "data_obj_literal" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["s1"], [{%{"name" => "pass"}, ["pass"]}]) + end +end diff --git a/test/scion_tests/default-initial-state/initial1_test.exs b/test/scion_tests/default-initial-state/initial1_test.exs new file mode 100644 index 0000000..cf56ad4 --- /dev/null +++ b/test/scion_tests/default-initial-state/initial1_test.exs @@ -0,0 +1,40 @@ +defmodule SCIONTest.DefaultInitialState.Initial1Test do + use SC.Case + @tag :scion + @tag spec: "default_initial_state" + test "initial1" do + xml = """ + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [{%{"name" => "t"}, ["b"]}]) + end +end diff --git a/test/scion_tests/default-initial-state/initial2_test.exs b/test/scion_tests/default-initial-state/initial2_test.exs new file mode 100644 index 0000000..9fc5fd7 --- /dev/null +++ b/test/scion_tests/default-initial-state/initial2_test.exs @@ -0,0 +1,40 @@ +defmodule SCIONTest.DefaultInitialState.Initial2Test do + use SC.Case + @tag :scion + @tag spec: "default_initial_state" + test "initial2" do + xml = """ + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [{%{"name" => "t"}, ["b"]}]) + end +end diff --git a/test/scion_tests/delayedSend/send1_test.exs b/test/scion_tests/delayedSend/send1_test.exs new file mode 100644 index 0000000..8a7ae4d --- /dev/null +++ b/test/scion_tests/delayedSend/send1_test.exs @@ -0,0 +1,49 @@ +defmodule SCIONTest.DelayedSend.Send1Test do + use SC.Case + @tag :scion + @tag spec: "delayed_send" + test "send1" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [{%{"name" => "t1"}, ["b"]}, {%{"name" => "t2"}, ["d"]}]) + end +end diff --git a/test/scion_tests/delayedSend/send2_test.exs b/test/scion_tests/delayedSend/send2_test.exs new file mode 100644 index 0000000..9c7bf12 --- /dev/null +++ b/test/scion_tests/delayedSend/send2_test.exs @@ -0,0 +1,52 @@ +defmodule SCIONTest.DelayedSend.Send2Test do + use SC.Case + @tag :scion + @tag spec: "delayed_send" + test "send2" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [{%{"name" => "t1"}, ["b"]}, {%{"name" => "t2"}, ["d"]}]) + end +end diff --git a/test/scion_tests/delayedSend/send3_test.exs b/test/scion_tests/delayedSend/send3_test.exs new file mode 100644 index 0000000..3218410 --- /dev/null +++ b/test/scion_tests/delayedSend/send3_test.exs @@ -0,0 +1,52 @@ +defmodule SCIONTest.DelayedSend.Send3Test do + use SC.Case + @tag :scion + @tag spec: "delayed_send" + test "send3" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [{%{"name" => "t1"}, ["b"]}, {%{"name" => "t2"}, ["d"]}]) + end +end diff --git a/test/scion_tests/documentOrder/documentOrder0_test.exs b/test/scion_tests/documentOrder/documentOrder0_test.exs new file mode 100644 index 0000000..f785f02 --- /dev/null +++ b/test/scion_tests/documentOrder/documentOrder0_test.exs @@ -0,0 +1,41 @@ +defmodule SCIONTest.DocumentOrder.DocumentOrder0Test do + use SC.Case + @tag :scion + @tag spec: "document_order" + test "documentOrder0" do + xml = """ + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [{%{"name" => "t"}, ["b"]}]) + end +end diff --git a/test/scion_tests/error/error_test.exs b/test/scion_tests/error/error_test.exs new file mode 100644 index 0000000..a333b1d --- /dev/null +++ b/test/scion_tests/error/error_test.exs @@ -0,0 +1,92 @@ +defmodule SCIONTest.Error.ErrorTest do + use SC.Case + @tag :scion + @tag spec: "error" + test "error" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["s1"], [{%{"name" => "e1"}, ["pass"]}]) + end +end diff --git a/test/scion_tests/foreach/test1_test.exs b/test/scion_tests/foreach/test1_test.exs new file mode 100644 index 0000000..912fb7f --- /dev/null +++ b/test/scion_tests/foreach/test1_test.exs @@ -0,0 +1,61 @@ +defmodule SCIONTest.Foreach.Test1Test do + use SC.Case + @tag :scion + @tag spec: "foreach" + test "test1" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [{%{"name" => "t"}, ["c"]}]) + end +end diff --git a/test/scion_tests/hierarchy+documentOrder/test0_test.exs b/test/scion_tests/hierarchy+documentOrder/test0_test.exs new file mode 100644 index 0000000..27f28c1 --- /dev/null +++ b/test/scion_tests/hierarchy+documentOrder/test0_test.exs @@ -0,0 +1,50 @@ +defmodule :"Elixir.Test.StateChart.Scion.Hierarchy+documentOrder.Test0" do + use SC.Case + @tag :scion + @tag spec: "hierarchy+document_order" + test "test0" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a1"], [{%{"name" => "t"}, ["a2"]}]) + end +end diff --git a/test/scion_tests/hierarchy+documentOrder/test1_test.exs b/test/scion_tests/hierarchy+documentOrder/test1_test.exs new file mode 100644 index 0000000..971f571 --- /dev/null +++ b/test/scion_tests/hierarchy+documentOrder/test1_test.exs @@ -0,0 +1,50 @@ +defmodule :"Elixir.Test.StateChart.Scion.Hierarchy+documentOrder.Test1" do + use SC.Case + @tag :scion + @tag spec: "hierarchy+document_order" + test "test1" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a1"], [{%{"name" => "t"}, ["b"]}]) + end +end diff --git a/test/scion_tests/hierarchy/hier0_test.exs b/test/scion_tests/hierarchy/hier0_test.exs new file mode 100644 index 0000000..0cc4463 --- /dev/null +++ b/test/scion_tests/hierarchy/hier0_test.exs @@ -0,0 +1,43 @@ +defmodule SCIONTest.Hierarchy.Hier0Test do + use SC.Case + @tag :scion + @tag spec: "hierarchy" + test "hier0" do + xml = """ + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a1"], [{%{"name" => "t"}, ["a2"]}]) + end +end diff --git a/test/scion_tests/hierarchy/hier1_test.exs b/test/scion_tests/hierarchy/hier1_test.exs new file mode 100644 index 0000000..253a2d0 --- /dev/null +++ b/test/scion_tests/hierarchy/hier1_test.exs @@ -0,0 +1,47 @@ +defmodule SCIONTest.Hierarchy.Hier1Test do + use SC.Case + @tag :scion + @tag spec: "hierarchy" + test "hier1" do + xml = """ + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a1"], [{%{"name" => "t"}, ["a2"]}]) + end +end diff --git a/test/scion_tests/hierarchy/hier2_test.exs b/test/scion_tests/hierarchy/hier2_test.exs new file mode 100644 index 0000000..1947246 --- /dev/null +++ b/test/scion_tests/hierarchy/hier2_test.exs @@ -0,0 +1,47 @@ +defmodule SCIONTest.Hierarchy.Hier2Test do + use SC.Case + @tag :scion + @tag spec: "hierarchy" + test "hier2" do + xml = """ + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a1"], [{%{"name" => "t"}, ["b"]}]) + end +end diff --git a/test/scion_tests/history/history0_test.exs b/test/scion_tests/history/history0_test.exs new file mode 100644 index 0000000..47fa96e --- /dev/null +++ b/test/scion_tests/history/history0_test.exs @@ -0,0 +1,60 @@ +defmodule SCIONTest.History.History0Test do + use SC.Case + @tag :scion + @tag spec: "history" + test "history0" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [ + {%{"name" => "t1"}, ["b2"]}, + {%{"name" => "t2"}, ["b3"]}, + {%{"name" => "t3"}, ["a"]}, + {%{"name" => "t1"}, ["b3"]} + ]) + end +end diff --git a/test/scion_tests/history/history1_test.exs b/test/scion_tests/history/history1_test.exs new file mode 100644 index 0000000..bf8a1db --- /dev/null +++ b/test/scion_tests/history/history1_test.exs @@ -0,0 +1,64 @@ +defmodule SCIONTest.History.History1Test do + use SC.Case + @tag :scion + @tag spec: "history" + test "history1" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [ + {%{"name" => "t1"}, ["b1.2"]}, + {%{"name" => "t2"}, ["b1.3"]}, + {%{"name" => "t3"}, ["a"]}, + {%{"name" => "t1"}, ["b1.3"]} + ]) + end +end diff --git a/test/scion_tests/history/history2_test.exs b/test/scion_tests/history/history2_test.exs new file mode 100644 index 0000000..2037191 --- /dev/null +++ b/test/scion_tests/history/history2_test.exs @@ -0,0 +1,64 @@ +defmodule SCIONTest.History.History2Test do + use SC.Case + @tag :scion + @tag spec: "history" + test "history2" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [ + {%{"name" => "t1"}, ["b1.2"]}, + {%{"name" => "t2"}, ["b1.3"]}, + {%{"name" => "t3"}, ["a"]}, + {%{"name" => "t1"}, ["b1.1"]} + ]) + end +end diff --git a/test/scion_tests/history/history3_test.exs b/test/scion_tests/history/history3_test.exs new file mode 100644 index 0000000..0ad018f --- /dev/null +++ b/test/scion_tests/history/history3_test.exs @@ -0,0 +1,68 @@ +defmodule SCIONTest.History.History3Test do + use SC.Case + @tag :scion + @tag spec: "history" + test "history3" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [ + {%{"name" => "t1"}, ["b1", "c1"]}, + {%{"name" => "t2"}, ["b2", "c2"]}, + {%{"name" => "t3"}, ["a"]}, + {%{"name" => "t4"}, ["b2", "c2"]} + ]) + end +end diff --git a/test/scion_tests/history/history4_test.exs b/test/scion_tests/history/history4_test.exs new file mode 100644 index 0000000..57c2e42 --- /dev/null +++ b/test/scion_tests/history/history4_test.exs @@ -0,0 +1,114 @@ +defmodule SCIONTest.History.History4Test do + use SC.Case + @tag :scion + @tag spec: "history" + test "history4" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [ + {%{"name" => "t1"}, ["b1.1", "c1.1"]}, + {%{"name" => "t2"}, ["b1.2", "c1.2"]}, + {%{"name" => "t3"}, ["b2.1", "c2.1"]}, + {%{"name" => "t4"}, ["b2.2", "c2.2"]}, + {%{"name" => "t5"}, ["a"]}, + {%{"name" => "t6"}, ["b2.2", "c2.1"]}, + {%{"name" => "t7"}, ["b2.2", "c2.2"]}, + {%{"name" => "t8"}, ["a"]}, + {%{"name" => "t9"}, ["b2.2", "c2.2"]} + ]) + end +end diff --git a/test/scion_tests/history/history4b_test.exs b/test/scion_tests/history/history4b_test.exs new file mode 100644 index 0000000..315a752 --- /dev/null +++ b/test/scion_tests/history/history4b_test.exs @@ -0,0 +1,114 @@ +defmodule SCIONTest.History.History4bTest do + use SC.Case + @tag :scion + @tag spec: "history" + test "history4b" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [ + {%{"name" => "t1"}, ["b1.1", "c1.1"]}, + {%{"name" => "t2"}, ["b1.2", "c1.2"]}, + {%{"name" => "t3"}, ["b2.1", "c2.1"]}, + {%{"name" => "t4"}, ["b2.2", "c2.2"]}, + {%{"name" => "t5"}, ["a"]}, + {%{"name" => "t6"}, ["b2.2", "c2.1"]}, + {%{"name" => "t7"}, ["b2.2", "c2.2"]}, + {%{"name" => "t8"}, ["a"]}, + {%{"name" => "t9"}, ["b2.2", "c2.2"]} + ]) + end +end diff --git a/test/scion_tests/history/history5_test.exs b/test/scion_tests/history/history5_test.exs new file mode 100644 index 0000000..5cc02da --- /dev/null +++ b/test/scion_tests/history/history5_test.exs @@ -0,0 +1,87 @@ +defmodule SCIONTest.History.History5Test do + use SC.Case + @tag :scion + @tag spec: "history" + test "history5" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["i1", "j", "h", "g", "f1", "k"], [ + {%{"name" => "t1"}, ["i2", "j", "h", "g", "f2", "k"]}, + {%{"name" => "t2"}, ["l"]}, + {%{"name" => "t3"}, ["i2", "j", "h", "g", "f2", "k"]} + ]) + end +end diff --git a/test/scion_tests/history/history6_test.exs b/test/scion_tests/history/history6_test.exs new file mode 100644 index 0000000..027159d --- /dev/null +++ b/test/scion_tests/history/history6_test.exs @@ -0,0 +1,91 @@ +defmodule SCIONTest.History.History6Test do + use SC.Case + @tag :scion + @tag spec: "history" + test "history6" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [ + {%{"name" => "t1"}, ["b2"]}, + {%{"name" => "t2"}, ["b3"]}, + {%{"name" => "t3"}, ["a"]}, + {%{"name" => "t1"}, ["b3"]}, + {%{"name" => "t4"}, ["success"]} + ]) + end +end diff --git a/test/scion_tests/if-else/test0_test.exs b/test/scion_tests/if-else/test0_test.exs new file mode 100644 index 0000000..96bfb22 --- /dev/null +++ b/test/scion_tests/if-else/test0_test.exs @@ -0,0 +1,117 @@ +defmodule SCIONTest.IfElse.Test0Test do + use SC.Case + @tag :scion + @tag spec: "if_else" + test "test0" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [{%{"name" => "t"}, ["c"]}]) + end +end diff --git a/test/scion_tests/in/TestInPredicate_test.exs b/test/scion_tests/in/TestInPredicate_test.exs new file mode 100644 index 0000000..53dfde1 --- /dev/null +++ b/test/scion_tests/in/TestInPredicate_test.exs @@ -0,0 +1,129 @@ +defmodule SCIONTest.In.TestInPredicateTest do + use SC.Case + @tag :scion + @tag spec: "in" + test "TestInPredicate" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a1", "a2"], [ + {%{"name" => "t1"}, ["b1", "a2"]}, + {%{"name" => "t2"}, ["c1", "a2"]}, + {%{"name" => "t3"}, ["d1", "a2"]}, + {%{"name" => "t4"}, ["e1", "a2"]}, + {%{"name" => "t5"}, ["f1", "a2"]}, + {%{"name" => "t6"}, ["g1", "b2"]}, + {%{"name" => "t7"}, ["h1", "d2"]}, + {%{"name" => "t8"}, ["i1", "d2"]}, + {%{"name" => "t9"}, ["j1", "e2"]}, + {%{"name" => "t10"}, ["k1", "e2"]} + ]) + end +end diff --git a/test/scion_tests/internal-transitions/test0.scxml.bak b/test/scion_tests/internal-transitions/test0.scxml.bak new file mode 100644 index 0000000..f9a620d --- /dev/null +++ b/test/scion_tests/internal-transitions/test0.scxml.bak @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/scion_tests/internal-transitions/test0_test.exs b/test/scion_tests/internal-transitions/test0_test.exs new file mode 100644 index 0000000..001defa --- /dev/null +++ b/test/scion_tests/internal-transitions/test0_test.exs @@ -0,0 +1,67 @@ +defmodule SCIONTest.InternalTransitions.Test0Test do + use SC.Case + @tag :scion + @tag spec: "internal_transitions" + test "test0" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a1"], [ + {%{"name" => "t1"}, ["a2"]}, + {%{"name" => "t2"}, ["b"]}, + {%{"name" => "t3"}, ["c"]} + ]) + end +end diff --git a/test/scion_tests/internal-transitions/test1_test.exs b/test/scion_tests/internal-transitions/test1_test.exs new file mode 100644 index 0000000..a479a4b --- /dev/null +++ b/test/scion_tests/internal-transitions/test1_test.exs @@ -0,0 +1,103 @@ +defmodule SCIONTest.InternalTransitions.Test1Test do + use SC.Case + @tag :scion + @tag spec: "internal_transitions" + test "test1" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a1", "b1"], [ + {%{"name" => "t1"}, ["a2", "b1"]}, + {%{"name" => "t2"}, ["c"]}, + {%{"name" => "t3"}, ["d"]} + ]) + end +end diff --git a/test/scion_tests/misc/deep-initial_test.exs b/test/scion_tests/misc/deep-initial_test.exs new file mode 100644 index 0000000..f7c6430 --- /dev/null +++ b/test/scion_tests/misc/deep-initial_test.exs @@ -0,0 +1,29 @@ +defmodule :"Elixir.Test.StateChart.Scion.Misc.Deep-initial" do + use SC.Case + @tag :scion + @tag spec: "misc" + test "deep-initial" do + xml = """ + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["s2"], []) + end +end diff --git a/test/scion_tests/more-parallel/test0_test.exs b/test/scion_tests/more-parallel/test0_test.exs new file mode 100644 index 0000000..ea25063 --- /dev/null +++ b/test/scion_tests/more-parallel/test0_test.exs @@ -0,0 +1,41 @@ +defmodule SCIONTest.MoreParallel.Test0Test do + use SC.Case + @tag :scion + @tag spec: "more_parallel" + test "test0" do + xml = """ + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a", "b"], [{%{"name" => "t"}, ["a", "b"]}]) + end +end diff --git a/test/scion_tests/more-parallel/test10_test.exs b/test/scion_tests/more-parallel/test10_test.exs new file mode 100644 index 0000000..a4b9d54 --- /dev/null +++ b/test/scion_tests/more-parallel/test10_test.exs @@ -0,0 +1,75 @@ +defmodule SCIONTest.MoreParallel.Test10Test do + use SC.Case + @tag :scion + @tag spec: "more_parallel" + test "test10" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a", "b"], [ + {%{"name" => "t1"}, ["a", "b"]}, + {%{"name" => "t2"}, ["a", "b"]}, + {%{"name" => "t3"}, ["a", "b"]} + ]) + end +end diff --git a/test/scion_tests/more-parallel/test10b_test.exs b/test/scion_tests/more-parallel/test10b_test.exs new file mode 100644 index 0000000..2dd9f31 --- /dev/null +++ b/test/scion_tests/more-parallel/test10b_test.exs @@ -0,0 +1,75 @@ +defmodule SCIONTest.MoreParallel.Test10bTest do + use SC.Case + @tag :scion + @tag spec: "more_parallel" + test "test10b" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a", "b"], [ + {%{"name" => "t1"}, ["a", "b"]}, + {%{"name" => "t2"}, ["c"]}, + {%{"name" => "t3"}, ["d"]} + ]) + end +end diff --git a/test/scion_tests/more-parallel/test1_test.exs b/test/scion_tests/more-parallel/test1_test.exs new file mode 100644 index 0000000..2f9d2ff --- /dev/null +++ b/test/scion_tests/more-parallel/test1_test.exs @@ -0,0 +1,52 @@ +defmodule SCIONTest.MoreParallel.Test1Test do + use SC.Case + @tag :scion + @tag spec: "more_parallel" + test "test1" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a1", "b1"], [{%{"name" => "t"}, ["a1", "b1"]}]) + end +end diff --git a/test/scion_tests/more-parallel/test2_test.exs b/test/scion_tests/more-parallel/test2_test.exs new file mode 100644 index 0000000..84a3c2f --- /dev/null +++ b/test/scion_tests/more-parallel/test2_test.exs @@ -0,0 +1,54 @@ +defmodule SCIONTest.MoreParallel.Test2Test do + use SC.Case + @tag :scion + @tag spec: "more_parallel" + test "test2" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a1", "b1"], [{%{"name" => "t"}, ["a1", "b1"]}]) + end +end diff --git a/test/scion_tests/more-parallel/test2b_test.exs b/test/scion_tests/more-parallel/test2b_test.exs new file mode 100644 index 0000000..79373a0 --- /dev/null +++ b/test/scion_tests/more-parallel/test2b_test.exs @@ -0,0 +1,54 @@ +defmodule SCIONTest.MoreParallel.Test2bTest do + use SC.Case + @tag :scion + @tag spec: "more_parallel" + test "test2b" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a1", "b1"], [{%{"name" => "t"}, ["a1", "b2"]}]) + end +end diff --git a/test/scion_tests/more-parallel/test3_test.exs b/test/scion_tests/more-parallel/test3_test.exs new file mode 100644 index 0000000..10e79ac --- /dev/null +++ b/test/scion_tests/more-parallel/test3_test.exs @@ -0,0 +1,54 @@ +defmodule SCIONTest.MoreParallel.Test3Test do + use SC.Case + @tag :scion + @tag spec: "more_parallel" + test "test3" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a1", "b1"], [{%{"name" => "t"}, ["a2", "b1"]}]) + end +end diff --git a/test/scion_tests/more-parallel/test3b_test.exs b/test/scion_tests/more-parallel/test3b_test.exs new file mode 100644 index 0000000..e87fbc1 --- /dev/null +++ b/test/scion_tests/more-parallel/test3b_test.exs @@ -0,0 +1,54 @@ +defmodule SCIONTest.MoreParallel.Test3bTest do + use SC.Case + @tag :scion + @tag spec: "more_parallel" + test "test3b" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a1", "b1"], [{%{"name" => "t"}, ["a1", "b2"]}]) + end +end diff --git a/test/scion_tests/more-parallel/test4_test.exs b/test/scion_tests/more-parallel/test4_test.exs new file mode 100644 index 0000000..486c9f4 --- /dev/null +++ b/test/scion_tests/more-parallel/test4_test.exs @@ -0,0 +1,54 @@ +defmodule SCIONTest.MoreParallel.Test4Test do + use SC.Case + @tag :scion + @tag spec: "more_parallel" + test "test4" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a1", "b1"], [{%{"name" => "t"}, ["a1", "b1"]}]) + end +end diff --git a/test/scion_tests/more-parallel/test5_test.exs b/test/scion_tests/more-parallel/test5_test.exs new file mode 100644 index 0000000..1532218 --- /dev/null +++ b/test/scion_tests/more-parallel/test5_test.exs @@ -0,0 +1,54 @@ +defmodule SCIONTest.MoreParallel.Test5Test do + use SC.Case + @tag :scion + @tag spec: "more_parallel" + test "test5" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a1", "b1"], [{%{"name" => "t"}, ["a2", "b1"]}]) + end +end diff --git a/test/scion_tests/more-parallel/test6_test.exs b/test/scion_tests/more-parallel/test6_test.exs new file mode 100644 index 0000000..97597be --- /dev/null +++ b/test/scion_tests/more-parallel/test6_test.exs @@ -0,0 +1,66 @@ +defmodule SCIONTest.MoreParallel.Test6Test do + use SC.Case + @tag :scion + @tag spec: "more_parallel" + test "test6" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a11", "b11"], [{%{"name" => "t"}, ["a22", "b11"]}]) + end +end diff --git a/test/scion_tests/more-parallel/test6b_test.exs b/test/scion_tests/more-parallel/test6b_test.exs new file mode 100644 index 0000000..6a8bb51 --- /dev/null +++ b/test/scion_tests/more-parallel/test6b_test.exs @@ -0,0 +1,66 @@ +defmodule SCIONTest.MoreParallel.Test6bTest do + use SC.Case + @tag :scion + @tag spec: "more_parallel" + test "test6b" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a11", "b11"], [{%{"name" => "t"}, ["a11", "b12"]}]) + end +end diff --git a/test/scion_tests/more-parallel/test7_test.exs b/test/scion_tests/more-parallel/test7_test.exs new file mode 100644 index 0000000..ff4acf5 --- /dev/null +++ b/test/scion_tests/more-parallel/test7_test.exs @@ -0,0 +1,66 @@ +defmodule SCIONTest.MoreParallel.Test7Test do + use SC.Case + @tag :scion + @tag spec: "more_parallel" + test "test7" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a11", "b11"], [{%{"name" => "t"}, ["a22", "b11"]}]) + end +end diff --git a/test/scion_tests/more-parallel/test8_test.exs b/test/scion_tests/more-parallel/test8_test.exs new file mode 100644 index 0000000..2119420 --- /dev/null +++ b/test/scion_tests/more-parallel/test8_test.exs @@ -0,0 +1,63 @@ +defmodule SCIONTest.MoreParallel.Test8Test do + use SC.Case + @tag :scion + @tag spec: "more_parallel" + test "test8" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["x"], [{%{"name" => "t"}, ["a22", "b11"]}]) + end +end diff --git a/test/scion_tests/more-parallel/test9_test.exs b/test/scion_tests/more-parallel/test9_test.exs new file mode 100644 index 0000000..7e40b9e --- /dev/null +++ b/test/scion_tests/more-parallel/test9_test.exs @@ -0,0 +1,63 @@ +defmodule SCIONTest.MoreParallel.Test9Test do + use SC.Case + @tag :scion + @tag spec: "more_parallel" + test "test9" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["x"], [{%{"name" => "t"}, ["a22", "b22"]}]) + end +end diff --git a/test/scion_tests/multiple-events-per-transition/test1_test.exs b/test/scion_tests/multiple-events-per-transition/test1_test.exs new file mode 100644 index 0000000..e8940d9 --- /dev/null +++ b/test/scion_tests/multiple-events-per-transition/test1_test.exs @@ -0,0 +1,51 @@ +defmodule SCIONTest.MultipleEventsPerTransition.Test1Test do + use SC.Case + @tag :scion + @tag spec: "multiple_events_per_transition" + test "test1" do + xml = """ + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [ + {%{"name" => "foo"}, ["b"]}, + {%{"name" => "bar"}, ["c"]}, + {%{"name" => "bat"}, ["d"]} + ]) + end +end diff --git a/test/scion_tests/parallel+interrupt/test0_test.exs b/test/scion_tests/parallel+interrupt/test0_test.exs new file mode 100644 index 0000000..08f912f --- /dev/null +++ b/test/scion_tests/parallel+interrupt/test0_test.exs @@ -0,0 +1,52 @@ +defmodule :"Elixir.Test.StateChart.Scion.Parallel+interrupt.Test0" do + use SC.Case + @tag :scion + @tag spec: "parallel+interrupt" + test "test0" do + xml = """ + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["c", "d"], [{%{"name" => "t"}, ["a1"]}]) + end +end diff --git a/test/scion_tests/parallel+interrupt/test10_test.exs b/test/scion_tests/parallel+interrupt/test10_test.exs new file mode 100644 index 0000000..2c92071 --- /dev/null +++ b/test/scion_tests/parallel+interrupt/test10_test.exs @@ -0,0 +1,60 @@ +defmodule :"Elixir.Test.StateChart.Scion.Parallel+interrupt.Test10" do + use SC.Case + @tag :scion + @tag spec: "parallel+interrupt" + test "test10" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["b1", "b2"], [{%{"name" => "t"}, ["c1", "c2"]}]) + end +end diff --git a/test/scion_tests/parallel+interrupt/test11_test.exs b/test/scion_tests/parallel+interrupt/test11_test.exs new file mode 100644 index 0000000..049f1ee --- /dev/null +++ b/test/scion_tests/parallel+interrupt/test11_test.exs @@ -0,0 +1,48 @@ +defmodule :"Elixir.Test.StateChart.Scion.Parallel+interrupt.Test11" do + use SC.Case + @tag :scion + @tag spec: "parallel+interrupt" + test "test11" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["b1", "b2"], [{%{"name" => "t"}, ["d"]}]) + end +end diff --git a/test/scion_tests/parallel+interrupt/test12_test.exs b/test/scion_tests/parallel+interrupt/test12_test.exs new file mode 100644 index 0000000..e3fe7ce --- /dev/null +++ b/test/scion_tests/parallel+interrupt/test12_test.exs @@ -0,0 +1,62 @@ +defmodule :"Elixir.Test.StateChart.Scion.Parallel+interrupt.Test12" do + use SC.Case + @tag :scion + @tag spec: "parallel+interrupt" + test "test12" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["b1", "b2"], [{%{"name" => "t"}, ["c1", "c2"]}]) + end +end diff --git a/test/scion_tests/parallel+interrupt/test13_test.exs b/test/scion_tests/parallel+interrupt/test13_test.exs new file mode 100644 index 0000000..1dc2ea8 --- /dev/null +++ b/test/scion_tests/parallel+interrupt/test13_test.exs @@ -0,0 +1,64 @@ +defmodule :"Elixir.Test.StateChart.Scion.Parallel+interrupt.Test13" do + use SC.Case + @tag :scion + @tag spec: "parallel+interrupt" + test "test13" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["b1", "b2"], [{%{"name" => "t"}, ["c1", "c2"]}]) + end +end diff --git a/test/scion_tests/parallel+interrupt/test14_test.exs b/test/scion_tests/parallel+interrupt/test14_test.exs new file mode 100644 index 0000000..8385dcf --- /dev/null +++ b/test/scion_tests/parallel+interrupt/test14_test.exs @@ -0,0 +1,77 @@ +defmodule :"Elixir.Test.StateChart.Scion.Parallel+interrupt.Test14" do + use SC.Case + @tag :scion + @tag spec: "parallel+interrupt" + test "test14" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["i1", "j", "h", "g", "f1", "k"], [{%{"name" => "t"}, ["l"]}]) + end +end diff --git a/test/scion_tests/parallel+interrupt/test15_test.exs b/test/scion_tests/parallel+interrupt/test15_test.exs new file mode 100644 index 0000000..fc9dd55 --- /dev/null +++ b/test/scion_tests/parallel+interrupt/test15_test.exs @@ -0,0 +1,78 @@ +defmodule :"Elixir.Test.StateChart.Scion.Parallel+interrupt.Test15" do + use SC.Case + @tag :scion + @tag spec: "parallel+interrupt" + test "test15" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["i1", "j", "h", "g", "f1", "k"], [ + {%{"name" => "t"}, ["i2", "j", "h", "g", "f1", "k"]} + ]) + end +end diff --git a/test/scion_tests/parallel+interrupt/test16_test.exs b/test/scion_tests/parallel+interrupt/test16_test.exs new file mode 100644 index 0000000..68d7582 --- /dev/null +++ b/test/scion_tests/parallel+interrupt/test16_test.exs @@ -0,0 +1,55 @@ +defmodule :"Elixir.Test.StateChart.Scion.Parallel+interrupt.Test16" do + use SC.Case + @tag :scion + @tag spec: "parallel+interrupt" + test "test16" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["c", "d"], [{%{"name" => "t"}, ["a1"]}]) + end +end diff --git a/test/scion_tests/parallel+interrupt/test17_test.exs b/test/scion_tests/parallel+interrupt/test17_test.exs new file mode 100644 index 0000000..ae7a522 --- /dev/null +++ b/test/scion_tests/parallel+interrupt/test17_test.exs @@ -0,0 +1,55 @@ +defmodule :"Elixir.Test.StateChart.Scion.Parallel+interrupt.Test17" do + use SC.Case + @tag :scion + @tag spec: "parallel+interrupt" + test "test17" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["c", "d"], [{%{"name" => "t"}, ["a2"]}]) + end +end diff --git a/test/scion_tests/parallel+interrupt/test18_test.exs b/test/scion_tests/parallel+interrupt/test18_test.exs new file mode 100644 index 0000000..40729e1 --- /dev/null +++ b/test/scion_tests/parallel+interrupt/test18_test.exs @@ -0,0 +1,48 @@ +defmodule :"Elixir.Test.StateChart.Scion.Parallel+interrupt.Test18" do + use SC.Case + @tag :scion + @tag spec: "parallel+interrupt" + test "test18" do + xml = """ + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["c", "d"], [{%{"name" => "t"}, ["a2"]}]) + end +end diff --git a/test/scion_tests/parallel+interrupt/test19_test.exs b/test/scion_tests/parallel+interrupt/test19_test.exs new file mode 100644 index 0000000..57630c1 --- /dev/null +++ b/test/scion_tests/parallel+interrupt/test19_test.exs @@ -0,0 +1,57 @@ +defmodule :"Elixir.Test.StateChart.Scion.Parallel+interrupt.Test19" do + use SC.Case + @tag :scion + @tag spec: "parallel+interrupt" + test "test19" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["c1", "d1"], [{%{"name" => "t"}, ["c2", "d2"]}]) + end +end diff --git a/test/scion_tests/parallel+interrupt/test1_test.exs b/test/scion_tests/parallel+interrupt/test1_test.exs new file mode 100644 index 0000000..cbadb95 --- /dev/null +++ b/test/scion_tests/parallel+interrupt/test1_test.exs @@ -0,0 +1,56 @@ +defmodule :"Elixir.Test.StateChart.Scion.Parallel+interrupt.Test1" do + use SC.Case + @tag :scion + @tag spec: "parallel+interrupt" + test "test1" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["c1", "d1"], [{%{"name" => "t"}, ["c2", "d1"]}]) + end +end diff --git a/test/scion_tests/parallel+interrupt/test20_test.exs b/test/scion_tests/parallel+interrupt/test20_test.exs new file mode 100644 index 0000000..8b73889 --- /dev/null +++ b/test/scion_tests/parallel+interrupt/test20_test.exs @@ -0,0 +1,57 @@ +defmodule :"Elixir.Test.StateChart.Scion.Parallel+interrupt.Test20" do + use SC.Case + @tag :scion + @tag spec: "parallel+interrupt" + test "test20" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["c1", "d"], [{%{"name" => "t"}, ["c2", "d"]}]) + end +end diff --git a/test/scion_tests/parallel+interrupt/test21_test.exs b/test/scion_tests/parallel+interrupt/test21_test.exs new file mode 100644 index 0000000..8b8b1bb --- /dev/null +++ b/test/scion_tests/parallel+interrupt/test21_test.exs @@ -0,0 +1,58 @@ +defmodule :"Elixir.Test.StateChart.Scion.Parallel+interrupt.Test21" do + use SC.Case + @tag :scion + @tag spec: "parallel+interrupt" + test "test21" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["c", "d1"], [{%{"name" => "t"}, ["a1"]}]) + end +end diff --git a/test/scion_tests/parallel+interrupt/test21b_test.exs b/test/scion_tests/parallel+interrupt/test21b_test.exs new file mode 100644 index 0000000..1eef0fa --- /dev/null +++ b/test/scion_tests/parallel+interrupt/test21b_test.exs @@ -0,0 +1,59 @@ +defmodule :"Elixir.Test.StateChart.Scion.Parallel+interrupt.Test21b" do + use SC.Case + @tag :scion + @tag spec: "parallel+interrupt" + test "test21b" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["c", "d1"], [{%{"name" => "t"}, ["a1"]}]) + end +end diff --git a/test/scion_tests/parallel+interrupt/test21c_test.exs b/test/scion_tests/parallel+interrupt/test21c_test.exs new file mode 100644 index 0000000..56eb60c --- /dev/null +++ b/test/scion_tests/parallel+interrupt/test21c_test.exs @@ -0,0 +1,60 @@ +defmodule :"Elixir.Test.StateChart.Scion.Parallel+interrupt.Test21c" do + use SC.Case + @tag :scion + @tag spec: "parallel+interrupt" + test "test21c" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["c", "d1"], [{%{"name" => "t"}, ["c", "d2"]}]) + end +end diff --git a/test/scion_tests/parallel+interrupt/test22_test.exs b/test/scion_tests/parallel+interrupt/test22_test.exs new file mode 100644 index 0000000..14c28b1 --- /dev/null +++ b/test/scion_tests/parallel+interrupt/test22_test.exs @@ -0,0 +1,59 @@ +defmodule :"Elixir.Test.StateChart.Scion.Parallel+interrupt.Test22" do + use SC.Case + @tag :scion + @tag spec: "parallel+interrupt" + test "test22" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["c1", "d1"], [{%{"name" => "t"}, ["c2", "d2"]}]) + end +end diff --git a/test/scion_tests/parallel+interrupt/test23_test.exs b/test/scion_tests/parallel+interrupt/test23_test.exs new file mode 100644 index 0000000..e408b18 --- /dev/null +++ b/test/scion_tests/parallel+interrupt/test23_test.exs @@ -0,0 +1,48 @@ +defmodule :"Elixir.Test.StateChart.Scion.Parallel+interrupt.Test23" do + use SC.Case + @tag :scion + @tag spec: "parallel+interrupt" + test "test23" do + xml = """ + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["c", "d"], [{%{"name" => "t"}, ["a2"]}]) + end +end diff --git a/test/scion_tests/parallel+interrupt/test24_test.exs b/test/scion_tests/parallel+interrupt/test24_test.exs new file mode 100644 index 0000000..f8dd6ba --- /dev/null +++ b/test/scion_tests/parallel+interrupt/test24_test.exs @@ -0,0 +1,57 @@ +defmodule :"Elixir.Test.StateChart.Scion.Parallel+interrupt.Test24" do + use SC.Case + @tag :scion + @tag spec: "parallel+interrupt" + test "test24" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["c1", "d1"], [{%{"name" => "t"}, ["c2", "d2"]}]) + end +end diff --git a/test/scion_tests/parallel+interrupt/test25_test.exs b/test/scion_tests/parallel+interrupt/test25_test.exs new file mode 100644 index 0000000..4dc171f --- /dev/null +++ b/test/scion_tests/parallel+interrupt/test25_test.exs @@ -0,0 +1,57 @@ +defmodule :"Elixir.Test.StateChart.Scion.Parallel+interrupt.Test25" do + use SC.Case + @tag :scion + @tag spec: "parallel+interrupt" + test "test25" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["c1", "d"], [{%{"name" => "t"}, ["c2", "d"]}]) + end +end diff --git a/test/scion_tests/parallel+interrupt/test27_test.exs b/test/scion_tests/parallel+interrupt/test27_test.exs new file mode 100644 index 0000000..ad7a644 --- /dev/null +++ b/test/scion_tests/parallel+interrupt/test27_test.exs @@ -0,0 +1,61 @@ +defmodule :"Elixir.Test.StateChart.Scion.Parallel+interrupt.Test27" do + use SC.Case + @tag :scion + @tag spec: "parallel+interrupt" + test "test27" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["c1", "d1"], [{%{"name" => "t"}, ["c2", "d2"]}]) + end +end diff --git a/test/scion_tests/parallel+interrupt/test28_test.exs b/test/scion_tests/parallel+interrupt/test28_test.exs new file mode 100644 index 0000000..22a0963 --- /dev/null +++ b/test/scion_tests/parallel+interrupt/test28_test.exs @@ -0,0 +1,55 @@ +defmodule :"Elixir.Test.StateChart.Scion.Parallel+interrupt.Test28" do + use SC.Case + @tag :scion + @tag spec: "parallel+interrupt" + test "test28" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["c", "d"], [{%{"name" => "t"}, ["a2"]}]) + end +end diff --git a/test/scion_tests/parallel+interrupt/test29_test.exs b/test/scion_tests/parallel+interrupt/test29_test.exs new file mode 100644 index 0000000..505dd1b --- /dev/null +++ b/test/scion_tests/parallel+interrupt/test29_test.exs @@ -0,0 +1,55 @@ +defmodule :"Elixir.Test.StateChart.Scion.Parallel+interrupt.Test29" do + use SC.Case + @tag :scion + @tag spec: "parallel+interrupt" + test "test29" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["c", "d"], [{%{"name" => "t"}, ["a1"]}]) + end +end diff --git a/test/scion_tests/parallel+interrupt/test2_test.exs b/test/scion_tests/parallel+interrupt/test2_test.exs new file mode 100644 index 0000000..fd7e9be --- /dev/null +++ b/test/scion_tests/parallel+interrupt/test2_test.exs @@ -0,0 +1,60 @@ +defmodule :"Elixir.Test.StateChart.Scion.Parallel+interrupt.Test2" do + use SC.Case + @tag :scion + @tag spec: "parallel+interrupt" + test "test2" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["c1", "d1"], [{%{"name" => "t"}, ["a1"]}]) + end +end diff --git a/test/scion_tests/parallel+interrupt/test30_test.exs b/test/scion_tests/parallel+interrupt/test30_test.exs new file mode 100644 index 0000000..e09bfbe --- /dev/null +++ b/test/scion_tests/parallel+interrupt/test30_test.exs @@ -0,0 +1,62 @@ +defmodule :"Elixir.Test.StateChart.Scion.Parallel+interrupt.Test30" do + use SC.Case + @tag :scion + @tag spec: "parallel+interrupt" + test "test30" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["c1", "d"], [{%{"name" => "t"}, ["c2", "d"]}]) + end +end diff --git a/test/scion_tests/parallel+interrupt/test31_test.exs b/test/scion_tests/parallel+interrupt/test31_test.exs new file mode 100644 index 0000000..0ba7b41 --- /dev/null +++ b/test/scion_tests/parallel+interrupt/test31_test.exs @@ -0,0 +1,65 @@ +defmodule :"Elixir.Test.StateChart.Scion.Parallel+interrupt.Test31" do + use SC.Case + @tag :scion + @tag spec: "parallel+interrupt" + test "test31" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["c1", "d1"], [{%{"name" => "t"}, ["a1"]}]) + end +end diff --git a/test/scion_tests/parallel+interrupt/test3_test.exs b/test/scion_tests/parallel+interrupt/test3_test.exs new file mode 100644 index 0000000..c1fb657 --- /dev/null +++ b/test/scion_tests/parallel+interrupt/test3_test.exs @@ -0,0 +1,50 @@ +defmodule :"Elixir.Test.StateChart.Scion.Parallel+interrupt.Test3" do + use SC.Case + @tag :scion + @tag spec: "parallel+interrupt" + test "test3" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["e", "f", "d"], [{%{"name" => "t"}, ["a1"]}]) + end +end diff --git a/test/scion_tests/parallel+interrupt/test4_test.exs b/test/scion_tests/parallel+interrupt/test4_test.exs new file mode 100644 index 0000000..8e30df0 --- /dev/null +++ b/test/scion_tests/parallel+interrupt/test4_test.exs @@ -0,0 +1,69 @@ +defmodule :"Elixir.Test.StateChart.Scion.Parallel+interrupt.Test4" do + use SC.Case + @tag :scion + @tag spec: "parallel+interrupt" + test "test4" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["e", "f", "g"], [{%{"name" => "t"}, ["a1"]}]) + end +end diff --git a/test/scion_tests/parallel+interrupt/test5_test.exs b/test/scion_tests/parallel+interrupt/test5_test.exs new file mode 100644 index 0000000..de9a4fb --- /dev/null +++ b/test/scion_tests/parallel+interrupt/test5_test.exs @@ -0,0 +1,67 @@ +defmodule :"Elixir.Test.StateChart.Scion.Parallel+interrupt.Test5" do + use SC.Case + @tag :scion + @tag spec: "parallel+interrupt" + test "test5" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["e", "f", "g"], [{%{"name" => "t"}, ["e", "f", "h"]}]) + end +end diff --git a/test/scion_tests/parallel+interrupt/test6_test.exs b/test/scion_tests/parallel+interrupt/test6_test.exs new file mode 100644 index 0000000..522afd8 --- /dev/null +++ b/test/scion_tests/parallel+interrupt/test6_test.exs @@ -0,0 +1,71 @@ +defmodule :"Elixir.Test.StateChart.Scion.Parallel+interrupt.Test6" do + use SC.Case + @tag :scion + @tag spec: "parallel+interrupt" + test "test6" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["g", "e1", "f1"], [{%{"name" => "t"}, ["h", "e2", "f2"]}]) + end +end diff --git a/test/scion_tests/parallel+interrupt/test7_test.exs b/test/scion_tests/parallel+interrupt/test7_test.exs new file mode 100644 index 0000000..4a0f5db --- /dev/null +++ b/test/scion_tests/parallel+interrupt/test7_test.exs @@ -0,0 +1,72 @@ +defmodule :"Elixir.Test.StateChart.Scion.Parallel+interrupt.Test7" do + use SC.Case + @tag :scion + @tag spec: "parallel+interrupt" + test "test7" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["c", "e1", "f1"], [{%{"name" => "t"}, ["a1"]}]) + end +end diff --git a/test/scion_tests/parallel+interrupt/test7b_test.exs b/test/scion_tests/parallel+interrupt/test7b_test.exs new file mode 100644 index 0000000..9a93f95 --- /dev/null +++ b/test/scion_tests/parallel+interrupt/test7b_test.exs @@ -0,0 +1,72 @@ +defmodule :"Elixir.Test.StateChart.Scion.Parallel+interrupt.Test7b" do + use SC.Case + @tag :scion + @tag spec: "parallel+interrupt" + test "test7b" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["c", "e1", "f1"], [{%{"name" => "t"}, ["c", "e2", "f2"]}]) + end +end diff --git a/test/scion_tests/parallel+interrupt/test8_test.exs b/test/scion_tests/parallel+interrupt/test8_test.exs new file mode 100644 index 0000000..05f69e4 --- /dev/null +++ b/test/scion_tests/parallel+interrupt/test8_test.exs @@ -0,0 +1,59 @@ +defmodule :"Elixir.Test.StateChart.Scion.Parallel+interrupt.Test8" do + use SC.Case + @tag :scion + @tag spec: "parallel+interrupt" + test "test8" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["b1", "b2"], [{%{"name" => "t"}, ["c1", "c2"]}]) + end +end diff --git a/test/scion_tests/parallel+interrupt/test9_test.exs b/test/scion_tests/parallel+interrupt/test9_test.exs new file mode 100644 index 0000000..2c23a35 --- /dev/null +++ b/test/scion_tests/parallel+interrupt/test9_test.exs @@ -0,0 +1,58 @@ +defmodule :"Elixir.Test.StateChart.Scion.Parallel+interrupt.Test9" do + use SC.Case + @tag :scion + @tag spec: "parallel+interrupt" + test "test9" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["b1", "b2"], [{%{"name" => "t"}, ["c1", "c2"]}]) + end +end diff --git a/test/scion_tests/parallel/test0_test.exs b/test/scion_tests/parallel/test0_test.exs new file mode 100644 index 0000000..0eefee1 --- /dev/null +++ b/test/scion_tests/parallel/test0_test.exs @@ -0,0 +1,40 @@ +defmodule SCIONTest.Parallel.Test0Test do + use SC.Case + @tag :scion + @tag spec: "parallel" + test "test0" do + xml = """ + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a", "b"], []) + end +end diff --git a/test/scion_tests/parallel/test1_test.exs b/test/scion_tests/parallel/test1_test.exs new file mode 100644 index 0000000..c5f7c40 --- /dev/null +++ b/test/scion_tests/parallel/test1_test.exs @@ -0,0 +1,60 @@ +defmodule SCIONTest.Parallel.Test1Test do + use SC.Case + @tag :scion + @tag spec: "parallel" + test "test1" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a1", "b1"], [{%{"name" => "t"}, ["a2", "b2"]}]) + end +end diff --git a/test/scion_tests/parallel/test2_test.exs b/test/scion_tests/parallel/test2_test.exs new file mode 100644 index 0000000..55c2612 --- /dev/null +++ b/test/scion_tests/parallel/test2_test.exs @@ -0,0 +1,73 @@ +defmodule SCIONTest.Parallel.Test2Test do + use SC.Case + @tag :scion + @tag spec: "parallel" + test "test2" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["s3", "s4", "s7", "s8"], [{%{"name" => "t"}, ["s5", "s6", "s9", "s10"]}]) + end +end diff --git a/test/scion_tests/parallel/test3_test.exs b/test/scion_tests/parallel/test3_test.exs new file mode 100644 index 0000000..3523b6e --- /dev/null +++ b/test/scion_tests/parallel/test3_test.exs @@ -0,0 +1,88 @@ +defmodule SCIONTest.Parallel.Test3Test do + use SC.Case + @tag :scion + @tag spec: "parallel" + test "test3" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["s3.1", "s4", "s7", "s8"], [ + {%{"name" => "t"}, ["s3.2", "s4", "s9", "s10"]} + ]) + end +end diff --git a/test/scion_tests/script-src/script-0-0.js b/test/scion_tests/script-src/script-0-0.js new file mode 100644 index 0000000..062f555 --- /dev/null +++ b/test/scion_tests/script-src/script-0-0.js @@ -0,0 +1 @@ +x = 100; diff --git a/test/scion_tests/script-src/script-1-0.js b/test/scion_tests/script-src/script-1-0.js new file mode 100644 index 0000000..226697f --- /dev/null +++ b/test/scion_tests/script-src/script-1-0.js @@ -0,0 +1 @@ +i = 0; diff --git a/test/scion_tests/script-src/script-1-1.js b/test/scion_tests/script-src/script-1-1.js new file mode 100644 index 0000000..8dca7b1 --- /dev/null +++ b/test/scion_tests/script-src/script-1-1.js @@ -0,0 +1 @@ +i = i + 1; diff --git a/test/scion_tests/script-src/script-2-0.js b/test/scion_tests/script-src/script-2-0.js new file mode 100644 index 0000000..226697f --- /dev/null +++ b/test/scion_tests/script-src/script-2-0.js @@ -0,0 +1 @@ +i = 0; diff --git a/test/scion_tests/script-src/script-2-1.js b/test/scion_tests/script-src/script-2-1.js new file mode 100644 index 0000000..8dca7b1 --- /dev/null +++ b/test/scion_tests/script-src/script-2-1.js @@ -0,0 +1 @@ +i = i + 1; diff --git a/test/scion_tests/script-src/script-2-2.js b/test/scion_tests/script-src/script-2-2.js new file mode 100644 index 0000000..8dca7b1 --- /dev/null +++ b/test/scion_tests/script-src/script-2-2.js @@ -0,0 +1 @@ +i = i + 1; diff --git a/test/scion_tests/script-src/script-2-3.js b/test/scion_tests/script-src/script-2-3.js new file mode 100644 index 0000000..795c1f2 --- /dev/null +++ b/test/scion_tests/script-src/script-2-3.js @@ -0,0 +1 @@ +i = i * 2; diff --git a/test/scion_tests/script-src/script-3-0.js b/test/scion_tests/script-src/script-3-0.js new file mode 100644 index 0000000..de469c4 --- /dev/null +++ b/test/scion_tests/script-src/script-3-0.js @@ -0,0 +1,3 @@ +function foo(){ + x = 100; +} diff --git a/test/scion_tests/script-src/test0_test.exs b/test/scion_tests/script-src/test0_test.exs new file mode 100644 index 0000000..8c89159 --- /dev/null +++ b/test/scion_tests/script-src/test0_test.exs @@ -0,0 +1,53 @@ +defmodule SCIONTest.ScriptSrc.Test0Test do + use SC.Case + @tag :scion + @tag spec: "script_src" + test "test0" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [{%{"name" => "t"}, ["b"]}]) + end +end diff --git a/test/scion_tests/script/test0_test.exs b/test/scion_tests/script/test0_test.exs new file mode 100644 index 0000000..8c8dd49 --- /dev/null +++ b/test/scion_tests/script/test0_test.exs @@ -0,0 +1,55 @@ +defmodule SCIONTest.Script.Test0Test do + use SC.Case + @tag :scion + @tag spec: "script" + test "test0" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [{%{"name" => "t"}, ["b"]}]) + end +end diff --git a/test/scion_tests/script/test1_test.exs b/test/scion_tests/script/test1_test.exs new file mode 100644 index 0000000..1d08e66 --- /dev/null +++ b/test/scion_tests/script/test1_test.exs @@ -0,0 +1,56 @@ +defmodule SCIONTest.Script.Test1Test do + use SC.Case + @tag :scion + @tag spec: "script" + test "test1" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [{%{"name" => "t"}, ["c"]}]) + end +end diff --git a/test/scion_tests/script/test2_test.exs b/test/scion_tests/script/test2_test.exs new file mode 100644 index 0000000..f560ac9 --- /dev/null +++ b/test/scion_tests/script/test2_test.exs @@ -0,0 +1,80 @@ +defmodule SCIONTest.Script.Test2Test do + use SC.Case + @tag :scion + @tag spec: "script" + test "test2" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [{%{"name" => "t"}, ["e"]}]) + end +end diff --git a/test/scion_tests/scxml-prefix-event-name-matching/star0_test.exs b/test/scion_tests/scxml-prefix-event-name-matching/star0_test.exs new file mode 100644 index 0000000..5880840 --- /dev/null +++ b/test/scion_tests/scxml-prefix-event-name-matching/star0_test.exs @@ -0,0 +1,44 @@ +defmodule SCIONTest.ScxmlPrefixEventNameMatching.Star0Test do + use SC.Case + @tag :scion + @tag spec: "scxml_prefix_event_name_matching" + test "star0" do + xml = """ + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [{%{"name" => "foo"}, ["b"]}]) + end +end diff --git a/test/scion_tests/scxml-prefix-event-name-matching/test0_test.exs b/test/scion_tests/scxml-prefix-event-name-matching/test0_test.exs new file mode 100644 index 0000000..faf4143 --- /dev/null +++ b/test/scion_tests/scxml-prefix-event-name-matching/test0_test.exs @@ -0,0 +1,68 @@ +defmodule SCIONTest.ScxmlPrefixEventNameMatching.Test0Test do + use SC.Case + @tag :scion + @tag spec: "scxml_prefix_event_name_matching" + test "test0" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [ + {%{"name" => "foo"}, ["b"]}, + {%{"name" => "foo.bar"}, ["c"]}, + {%{"name" => "foo.bar.bat"}, ["d"]}, + {%{"name" => "foo.bar.bat"}, ["e"]}, + {%{"name" => "foo"}, ["e"]}, + {%{"name" => "foo.bar.bat"}, ["f"]}, + {%{"name" => "foobar"}, ["f"]}, + {%{"name" => "foo.bar.bat.bif"}, ["g"]} + ]) + end +end diff --git a/test/scion_tests/scxml-prefix-event-name-matching/test1_test.exs b/test/scion_tests/scxml-prefix-event-name-matching/test1_test.exs new file mode 100644 index 0000000..cdeadf3 --- /dev/null +++ b/test/scion_tests/scxml-prefix-event-name-matching/test1_test.exs @@ -0,0 +1,73 @@ +defmodule SCIONTest.ScxmlPrefixEventNameMatching.Test1Test do + use SC.Case + @tag :scion + @tag spec: "scxml_prefix_event_name_matching" + test "test1" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [ + {%{"name" => "foo"}, ["b"]}, + {%{"name" => "foo.bar"}, ["c"]}, + {%{"name" => "foo.bar.bat"}, ["d"]}, + {%{"name" => "foo.bar.bat"}, ["e"]}, + {%{"name" => "foo"}, ["e"]}, + {%{"name" => "foo.bar.bat"}, ["f"]}, + {%{"name" => "foobar"}, ["f"]}, + {%{"name" => "foo.bar.bat.bif"}, ["g"]} + ]) + end +end diff --git a/test/scion_tests/send-data/send1_test.exs b/test/scion_tests/send-data/send1_test.exs new file mode 100644 index 0000000..1847127 --- /dev/null +++ b/test/scion_tests/send-data/send1_test.exs @@ -0,0 +1,91 @@ +defmodule SCIONTest.SendData.Send1Test do + use SC.Case + @tag :scion + @tag spec: "send_data" + test "send1" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + More content. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [{%{"name" => "t"}, ["b"]}, {%{"name" => "t2"}, ["e"]}]) + end +end diff --git a/test/scion_tests/send-idlocation/test0_test.exs b/test/scion_tests/send-idlocation/test0_test.exs new file mode 100644 index 0000000..c9aa27a --- /dev/null +++ b/test/scion_tests/send-idlocation/test0_test.exs @@ -0,0 +1,55 @@ +defmodule SCIONTest.SendIdlocation.Test0Test do + use SC.Case + @tag :scion + @tag spec: "send_idlocation" + test "test0" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["s0"], [{%{"name" => "t1"}, ["s1"]}, {%{"name" => "t2"}, ["pass"]}]) + end +end diff --git a/test/scion_tests/send-internal/test0_test.exs b/test/scion_tests/send-internal/test0_test.exs new file mode 100644 index 0000000..bf7d1be --- /dev/null +++ b/test/scion_tests/send-internal/test0_test.exs @@ -0,0 +1,77 @@ +defmodule SCIONTest.SendInternal.Test0Test do + use SC.Case + @tag :scion + @tag spec: "send_internal" + test "test0" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + More content. + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [{%{"name" => "t"}, ["d"]}]) + end +end diff --git a/test/scion_tests/targetless-transition/test0_test.exs b/test/scion_tests/targetless-transition/test0_test.exs new file mode 100644 index 0000000..900ed2f --- /dev/null +++ b/test/scion_tests/targetless-transition/test0_test.exs @@ -0,0 +1,50 @@ +defmodule SCIONTest.TargetlessTransition.Test0Test do + use SC.Case + @tag :scion + @tag spec: "targetless_transition" + test "test0" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [{%{"name" => "t"}, ["done"]}]) + end +end diff --git a/test/scion_tests/targetless-transition/test1_test.exs b/test/scion_tests/targetless-transition/test1_test.exs new file mode 100644 index 0000000..be067f0 --- /dev/null +++ b/test/scion_tests/targetless-transition/test1_test.exs @@ -0,0 +1,53 @@ +defmodule SCIONTest.TargetlessTransition.Test1Test do + use SC.Case + @tag :scion + @tag spec: "targetless_transition" + test "test1" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [{%{"name" => "foo"}, ["a"]}, {%{"name" => "bar"}, ["done"]}]) + end +end diff --git a/test/scion_tests/targetless-transition/test2_test.exs b/test/scion_tests/targetless-transition/test2_test.exs new file mode 100644 index 0000000..f0ae285 --- /dev/null +++ b/test/scion_tests/targetless-transition/test2_test.exs @@ -0,0 +1,56 @@ +defmodule SCIONTest.TargetlessTransition.Test2Test do + use SC.Case + @tag :scion + @tag spec: "targetless_transition" + test "test2" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a"], [{%{"name" => "foo"}, ["a"]}, {%{"name" => "bar"}, ["done"]}]) + end +end diff --git a/test/scion_tests/targetless-transition/test3_test.exs b/test/scion_tests/targetless-transition/test3_test.exs new file mode 100644 index 0000000..0929db2 --- /dev/null +++ b/test/scion_tests/targetless-transition/test3_test.exs @@ -0,0 +1,84 @@ +defmodule SCIONTest.TargetlessTransition.Test3Test do + use SC.Case + @tag :scion + @tag spec: "targetless_transition" + test "test3" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + test_scxml(xml, "", ["a1", "b1", "c"], [ + {%{"name" => "foo"}, ["a2", "b2", "c"]}, + {%{"name" => "bar"}, ["done"]} + ]) + end +end diff --git a/test/scxml_tests/mandatory/EvaluationofExecutableContent/test158_test.exs b/test/scxml_tests/mandatory/EvaluationofExecutableContent/test158_test.exs new file mode 100644 index 0000000..433c0c1 --- /dev/null +++ b/test/scxml_tests/mandatory/EvaluationofExecutableContent/test158_test.exs @@ -0,0 +1,42 @@ +defmodule Test.StateChart.W3.EvaluationofExecutableContent.Test158 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "EvaluationofExecutableContent" + test "test158" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "The SCXML processor MUST execute the elements of a block of executable contentin document order." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/EvaluationofExecutableContent/test159_test.exs b/test/scxml_tests/mandatory/EvaluationofExecutableContent/test159_test.exs new file mode 100644 index 0000000..a171185 --- /dev/null +++ b/test/scxml_tests/mandatory/EvaluationofExecutableContent/test159_test.exs @@ -0,0 +1,38 @@ +defmodule Test.StateChart.W3.EvaluationofExecutableContent.Test159 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "EvaluationofExecutableContent" + test "test159" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "If the processing of an element of executable content causes an error to be raised, the processor MUST NOT process the remaining elements of the block." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/SelectingTransitions/test403a_test.exs b/test/scxml_tests/mandatory/SelectingTransitions/test403a_test.exs new file mode 100644 index 0000000..1307953 --- /dev/null +++ b/test/scxml_tests/mandatory/SelectingTransitions/test403a_test.exs @@ -0,0 +1,49 @@ +defmodule Test.StateChart.W3.SelectingTransitions.Test403a do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "SelectingTransitions" + test "test403a" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "To execute a microstep, the SCXML Processor MUST execute the transitions in the corresponding optimal enabled transition set, where the optimal transition set enabled by event E in state configuration C is the largest set of transitions such that a) each transition in the set is optimally enabled by E in an atomic state in C b) no transition conflicts with another transition in the set c) there is no optimally enabled transition outside the set that has a higher priority than some member of the set." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/SelectingTransitions/test403b_test.exs b/test/scxml_tests/mandatory/SelectingTransitions/test403b_test.exs new file mode 100644 index 0000000..9f1be09 --- /dev/null +++ b/test/scxml_tests/mandatory/SelectingTransitions/test403b_test.exs @@ -0,0 +1,49 @@ +defmodule Test.StateChart.W3.SelectingTransitions.Test403b do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "SelectingTransitions" + test "test403b" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "To execute a microstep, the SCXML Processor MUST execute the transitions in the corresponding optimal enabled transition set, where the optimal transition set enabled by event E in state configuration C is the largest set of transitions such that a) each transition in the set is optimally enabled by E in an atomic state in C b) no transition conflicts with another transition in the set c) there is no optimally enabled transition outside the set that has a higher priority than some member of the set." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/SelectingTransitions/test403c_test.exs b/test/scxml_tests/mandatory/SelectingTransitions/test403c_test.exs new file mode 100644 index 0000000..eb5ee45 --- /dev/null +++ b/test/scxml_tests/mandatory/SelectingTransitions/test403c_test.exs @@ -0,0 +1,64 @@ +defmodule Test.StateChart.W3.SelectingTransitions.Test403c do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "SelectingTransitions" + test "test403c" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "To execute a microstep, the SCXML Processor MUST execute the transitions in the corresponding optimal enabled transition set, where the optimal transition set enabled by event E in state configuration C is the largest set of transitions such that a) each transition in the set is optimally enabled by E in an atomic state in C b) no transition conflicts with another transition in the set c) there is no optimally enabled transition outside the set that has a higher priority than some member of the set." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/SelectingTransitions/test404_test.exs b/test/scxml_tests/mandatory/SelectingTransitions/test404_test.exs new file mode 100644 index 0000000..7ae6520 --- /dev/null +++ b/test/scxml_tests/mandatory/SelectingTransitions/test404_test.exs @@ -0,0 +1,63 @@ +defmodule Test.StateChart.W3.SelectingTransitions.Test404 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "SelectingTransitions" + test "test404" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "To execute a set of transitions, the SCXML Processor MUST first exit all the states in the transitions' exit set in exit order." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/SelectingTransitions/test405_test.exs b/test/scxml_tests/mandatory/SelectingTransitions/test405_test.exs new file mode 100644 index 0000000..eb6bd04 --- /dev/null +++ b/test/scxml_tests/mandatory/SelectingTransitions/test405_test.exs @@ -0,0 +1,70 @@ +defmodule Test.StateChart.W3.SelectingTransitions.Test405 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "SelectingTransitions" + test "test405" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "[the SCXML Processor executing a set of transitions] MUST then [after the onexits] execute the executable content contained in the transitions in document order." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/SelectingTransitions/test406_test.exs b/test/scxml_tests/mandatory/SelectingTransitions/test406_test.exs new file mode 100644 index 0000000..78ea034 --- /dev/null +++ b/test/scxml_tests/mandatory/SelectingTransitions/test406_test.exs @@ -0,0 +1,66 @@ +defmodule Test.StateChart.W3.SelectingTransitions.Test406 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "SelectingTransitions" + test "test406" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "[the SCXML Processor executing a set of transitions] MUST then [after the exits and the transitions] enter the states in the transitions' entry set in entry order." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/SelectingTransitions/test407_test.exs b/test/scxml_tests/mandatory/SelectingTransitions/test407_test.exs new file mode 100644 index 0000000..43f7467 --- /dev/null +++ b/test/scxml_tests/mandatory/SelectingTransitions/test407_test.exs @@ -0,0 +1,40 @@ +defmodule Test.StateChart.W3.SelectingTransitions.Test407 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "SelectingTransitions" + test "test407" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "To exit a state, the SCXML Processor MUST execute the executable content in the state's onexit handler." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/SelectingTransitions/test409_test.exs b/test/scxml_tests/mandatory/SelectingTransitions/test409_test.exs new file mode 100644 index 0000000..a22f846 --- /dev/null +++ b/test/scxml_tests/mandatory/SelectingTransitions/test409_test.exs @@ -0,0 +1,45 @@ +defmodule Test.StateChart.W3.SelectingTransitions.Test409 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "SelectingTransitions" + test "test409" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "Finally [after the onexits and canceling the invocations], the Processor MUST remove the state from the active state's list." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/SelectingTransitions/test411_test.exs b/test/scxml_tests/mandatory/SelectingTransitions/test411_test.exs new file mode 100644 index 0000000..b5d9c61 --- /dev/null +++ b/test/scxml_tests/mandatory/SelectingTransitions/test411_test.exs @@ -0,0 +1,45 @@ +defmodule Test.StateChart.W3.SelectingTransitions.Test411 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "SelectingTransitions" + test "test411" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "To enter a state, the SCXML Processor MUST add the state to the active state's list. Then it MUST execute the executable content in the state's onentry handler." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/SelectingTransitions/test412_test.exs b/test/scxml_tests/mandatory/SelectingTransitions/test412_test.exs new file mode 100644 index 0000000..f1763bb --- /dev/null +++ b/test/scxml_tests/mandatory/SelectingTransitions/test412_test.exs @@ -0,0 +1,63 @@ +defmodule Test.StateChart.W3.SelectingTransitions.Test412 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "SelectingTransitions" + test "test412" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "If the state is a default entry state and has an initial child, the SCXML Processor MUST then [after doing the active state add and the onentry handlers] execute the executable content in the initial child's transition." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/SelectingTransitions/test413_test.exs b/test/scxml_tests/mandatory/SelectingTransitions/test413_test.exs new file mode 100644 index 0000000..501e99a --- /dev/null +++ b/test/scxml_tests/mandatory/SelectingTransitions/test413_test.exs @@ -0,0 +1,51 @@ +defmodule Test.StateChart.W3.SelectingTransitions.Test413 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "SelectingTransitions" + test "test413" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "At startup, the SCXML Processor MUST place the state machine in the configuration specified by the 'initial' attribute of the scxml element." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/SelectingTransitions/test416_test.exs b/test/scxml_tests/mandatory/SelectingTransitions/test416_test.exs new file mode 100644 index 0000000..d0a382b --- /dev/null +++ b/test/scxml_tests/mandatory/SelectingTransitions/test416_test.exs @@ -0,0 +1,40 @@ +defmodule Test.StateChart.W3.SelectingTransitions.Test416 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "SelectingTransitions" + test "test416" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "If it [the SCXML processor] has entered a final state that is a child of a compound state [during the last microstep], it MUST generate the event done.state.id, where id is the id of the compound state." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/SelectingTransitions/test417_test.exs b/test/scxml_tests/mandatory/SelectingTransitions/test417_test.exs new file mode 100644 index 0000000..57fbc2c --- /dev/null +++ b/test/scxml_tests/mandatory/SelectingTransitions/test417_test.exs @@ -0,0 +1,48 @@ +defmodule Test.StateChart.W3.SelectingTransitions.Test417 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "SelectingTransitions" + test "test417" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "If the compound state [which has the final element that we entered this microstep] is itself the child of a parallel element, and all the parallel element's other children are in final states, the Processor MUST generate the event done.state.id, where id is the id of the parallel element." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/SelectingTransitions/test419_test.exs b/test/scxml_tests/mandatory/SelectingTransitions/test419_test.exs new file mode 100644 index 0000000..6464018 --- /dev/null +++ b/test/scxml_tests/mandatory/SelectingTransitions/test419_test.exs @@ -0,0 +1,35 @@ +defmodule Test.StateChart.W3.SelectingTransitions.Test419 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "SelectingTransitions" + test "test419" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "After checking the state configuration, the Processor MUST select the optimal transition set enabled by NULL in the current configuration. If the [optimal transition] set [enabled by NULL in the current configuration] is not empty, it [the SCXML Processor] MUST execute it [the set] as a microstep." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/SelectingTransitions/test421_test.exs b/test/scxml_tests/mandatory/SelectingTransitions/test421_test.exs new file mode 100644 index 0000000..10e4ad5 --- /dev/null +++ b/test/scxml_tests/mandatory/SelectingTransitions/test421_test.exs @@ -0,0 +1,43 @@ +defmodule Test.StateChart.W3.SelectingTransitions.Test421 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "SelectingTransitions" + test "test421" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "If the set (of eventless transitions) is empty, the Processor MUST remove events from the internal event queue until the queue is empty or it finds an event that enables a non-empty optimal transition set in the current configuration. If it finds such a set [a non-empty optimal transition set], the processor MUST then execute it as a microstep." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/SelectingTransitions/test422_test.exs b/test/scxml_tests/mandatory/SelectingTransitions/test422_test.exs new file mode 100644 index 0000000..b7f7d6f --- /dev/null +++ b/test/scxml_tests/mandatory/SelectingTransitions/test422_test.exs @@ -0,0 +1,86 @@ +defmodule Test.StateChart.W3.SelectingTransitions.Test422 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "SelectingTransitions" + test "test422" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "After completing a macrostep, the SCXML Processor MUST execute in document order the invoke handlers in all states that have been entered (and not exited) since the completion of the last macrostep." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/SelectingTransitions/test423_test.exs b/test/scxml_tests/mandatory/SelectingTransitions/test423_test.exs new file mode 100644 index 0000000..28e2057 --- /dev/null +++ b/test/scxml_tests/mandatory/SelectingTransitions/test423_test.exs @@ -0,0 +1,40 @@ +defmodule Test.StateChart.W3.SelectingTransitions.Test423 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "SelectingTransitions" + test "test423" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "Then [after invoking the new invoke handlers since the last macrostep] the Processor MUST remove events from the external event queue, waiting till events appear if necessary, until it finds one that enables a non-empty optimal transition set in the current configuration. The Processor MUST then execute that set [the enabled non-empty optimal transition set in the current configuration triggered by an external event] as a microstep." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/SelectingTransitions/test503_test.exs b/test/scxml_tests/mandatory/SelectingTransitions/test503_test.exs new file mode 100644 index 0000000..8dbb992 --- /dev/null +++ b/test/scxml_tests/mandatory/SelectingTransitions/test503_test.exs @@ -0,0 +1,51 @@ +defmodule Test.StateChart.W3.SelectingTransitions.Test503 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "SelectingTransitions" + test "test503" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = "If the transition does not contain a 'target', its exit set is empty." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/SelectingTransitions/test504_test.exs b/test/scxml_tests/mandatory/SelectingTransitions/test504_test.exs new file mode 100644 index 0000000..2462c04 --- /dev/null +++ b/test/scxml_tests/mandatory/SelectingTransitions/test504_test.exs @@ -0,0 +1,84 @@ +defmodule Test.StateChart.W3.SelectingTransitions.Test504 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "SelectingTransitions" + test "test504" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "if [a transition's] 'type' is \"external\", its exit set consists of all active states that are proper descendents of the Least Common Compound Ancestor (LCCA) of the source and target states. \n " + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/SelectingTransitions/test505_test.exs b/test/scxml_tests/mandatory/SelectingTransitions/test505_test.exs new file mode 100644 index 0000000..a3543c2 --- /dev/null +++ b/test/scxml_tests/mandatory/SelectingTransitions/test505_test.exs @@ -0,0 +1,60 @@ +defmodule Test.StateChart.W3.SelectingTransitions.Test505 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "SelectingTransitions" + test "test505" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "Otherwise, if the transition has 'type' \"internal\", its source state is a compound state and all its target states are proper descendents of its source state, the target set consists of all active states that are proper descendents of its source state.\n " + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/SelectingTransitions/test506_test.exs b/test/scxml_tests/mandatory/SelectingTransitions/test506_test.exs new file mode 100644 index 0000000..4ae373c --- /dev/null +++ b/test/scxml_tests/mandatory/SelectingTransitions/test506_test.exs @@ -0,0 +1,63 @@ +defmodule Test.StateChart.W3.SelectingTransitions.Test506 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "SelectingTransitions" + test "test506" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "If a transition has 'type' of \"internal\", but its source state is not a compound state or its target states are not all proper descendents of its source state, its exit set is defined as if it had 'type' of \"external\".\n " + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/SelectingTransitions/test533_test.exs b/test/scxml_tests/mandatory/SelectingTransitions/test533_test.exs new file mode 100644 index 0000000..ecbfb85 --- /dev/null +++ b/test/scxml_tests/mandatory/SelectingTransitions/test533_test.exs @@ -0,0 +1,73 @@ +defmodule Test.StateChart.W3.SelectingTransitions.Test533 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "SelectingTransitions" + test "test533" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "If a transition has 'type' of \"internal\", but its source state is not a compound state, its exit set is defined as if it had 'type' of \"external\".\n " + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/data/test276_test.exs b/test/scxml_tests/mandatory/data/test276_test.exs new file mode 100644 index 0000000..14df2cb --- /dev/null +++ b/test/scxml_tests/mandatory/data/test276_test.exs @@ -0,0 +1,34 @@ +defmodule Test.StateChart.W3.Data.Test276 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "data" + test "test276" do + xml = """ + + + + + + + + + + + + + + + + + + + + + """ + + description = + "The SCXML Processor MUST allow the environment to provide values for top-level data elements at instantiation time. (Top-level data elements are those that are children of the datamodel element that is a child of scxml). Specifically, the Processor MUST use the values provided at instantiation time instead of those contained in these data elements." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/data/test276sub1_test.exs b/test/scxml_tests/mandatory/data/test276sub1_test.exs new file mode 100644 index 0000000..b067c2f --- /dev/null +++ b/test/scxml_tests/mandatory/data/test276sub1_test.exs @@ -0,0 +1,29 @@ +defmodule Test.StateChart.W3.Data.Test276sub1 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "data" + test "test276sub1" do + xml = """ + + + + + + + + + + + + + + + + """ + + description = + "The SCXML Processor MUST allow the environment to provide values for top-level data elements at instantiation time. (Top-level data elements are those that are children of the datamodel element that is a child of scxml). Specifically, the Processor MUST use the values provided at instantiation time instead of those contained in these data elements." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/data/test277_test.exs b/test/scxml_tests/mandatory/data/test277_test.exs new file mode 100644 index 0000000..4cfecf7 --- /dev/null +++ b/test/scxml_tests/mandatory/data/test277_test.exs @@ -0,0 +1,44 @@ +defmodule Test.StateChart.W3.Data.Test277 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "data" + test "test277" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "If the value specified for a data element (by 'src', children, or the environment) is not a legal data value, the SCXML Processor MUST raise place error.execution in the internal event queue and MUST create an empty data element in the data model with the specified id." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/data/test279_test.exs b/test/scxml_tests/mandatory/data/test279_test.exs new file mode 100644 index 0000000..bcbba42 --- /dev/null +++ b/test/scxml_tests/mandatory/data/test279_test.exs @@ -0,0 +1,37 @@ +defmodule Test.StateChart.W3.Data.Test279 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "data" + test "test279" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "When 'binding' attribute on the scxml element is assigned the value \"early\" (the default), the SCXML Processor MUST create all data elements and assign their initial values at document initialization time.\n " + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/data/test280_test.exs b/test/scxml_tests/mandatory/data/test280_test.exs new file mode 100644 index 0000000..52026e3 --- /dev/null +++ b/test/scxml_tests/mandatory/data/test280_test.exs @@ -0,0 +1,45 @@ +defmodule Test.StateChart.W3.Data.Test280 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "data" + test "test280" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "When 'binding' attribute on the scxml element is assigned the value \"late\", the SCXML Processor MUST create the data elements at document initialization time, but MUST assign the specified initial value to a given data element only when the state that contains it is entered for the first time, before any onentry markup.\n " + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/data/test550_test.exs b/test/scxml_tests/mandatory/data/test550_test.exs new file mode 100644 index 0000000..f781c5d --- /dev/null +++ b/test/scxml_tests/mandatory/data/test550_test.exs @@ -0,0 +1,36 @@ +defmodule Test.StateChart.W3.Data.Test550 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "data" + test "test550" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "If the 'expr' attribute is present, the Platform MUST evaluate the corresponding expression at the time specified by the 'binding' attribute of scxml and MUST assign the resulting value as the value of the data element" + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/data/test551_test.exs b/test/scxml_tests/mandatory/data/test551_test.exs new file mode 100644 index 0000000..03f1619 --- /dev/null +++ b/test/scxml_tests/mandatory/data/test551_test.exs @@ -0,0 +1,38 @@ +defmodule Test.StateChart.W3.Data.Test551 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "data" + test "test551" do + xml = """ + + + + + + + + + + [1,2,3] + + + + + + + + + + + + + + + """ + + description = + "f child content is specified, the Platform MUST assign it as the value of the data element at the time specified by the 'binding' attribute of scxml." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/events/test396_test.exs b/test/scxml_tests/mandatory/events/test396_test.exs new file mode 100644 index 0000000..e71fb9a --- /dev/null +++ b/test/scxml_tests/mandatory/events/test396_test.exs @@ -0,0 +1,34 @@ +defmodule Test.StateChart.W3.Events.Test396 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "events" + test "test396" do + xml = """ + + + + + + + + + + + + + + + + + + + + + """ + + description = + "The SCXML processor MUST use this same name value [the one reflected in the event variable] to match against the 'event' attribute of transitions." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/events/test399_test.exs b/test/scxml_tests/mandatory/events/test399_test.exs new file mode 100644 index 0000000..1490155 --- /dev/null +++ b/test/scxml_tests/mandatory/events/test399_test.exs @@ -0,0 +1,70 @@ +defmodule Test.StateChart.W3.Events.Test399 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "events" + test "test399" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "[Definition: A transition matches an event if at least one of its event descriptors matches the event's name. ] [Definition: An event descriptor matches an event name if its string of tokens is an exact match or a prefix of the set of tokens in the event's name. In all cases, the token matching is case sensitive. ]" + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/events/test401_test.exs b/test/scxml_tests/mandatory/events/test401_test.exs new file mode 100644 index 0000000..940cacd --- /dev/null +++ b/test/scxml_tests/mandatory/events/test401_test.exs @@ -0,0 +1,34 @@ +defmodule Test.StateChart.W3.Events.Test401 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "events" + test "test401" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + """ + + description = "The processor MUST place these [error] events in the internal event queue." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/events/test402_test.exs b/test/scxml_tests/mandatory/events/test402_test.exs new file mode 100644 index 0000000..85361b7 --- /dev/null +++ b/test/scxml_tests/mandatory/events/test402_test.exs @@ -0,0 +1,50 @@ +defmodule Test.StateChart.W3.Events.Test402 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "events" + test "test402" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = "The processor MUST process them [error events] like any other event." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/final/test372_test.exs b/test/scxml_tests/mandatory/final/test372_test.exs new file mode 100644 index 0000000..92c4985 --- /dev/null +++ b/test/scxml_tests/mandatory/final/test372_test.exs @@ -0,0 +1,45 @@ +defmodule Test.StateChart.W3.Final.Test372 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "final" + test "test372" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "When the state machine enters the final child of a state element, the SCXML processor MUST generate the event done.state.id after completion of the onentry elements, where id is the id of the parent state." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/final/test570_test.exs b/test/scxml_tests/mandatory/final/test570_test.exs new file mode 100644 index 0000000..9a53822 --- /dev/null +++ b/test/scxml_tests/mandatory/final/test570_test.exs @@ -0,0 +1,58 @@ +defmodule Test.StateChart.W3.Final.Test570 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "final" + test "test570" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "Immediately after generating done.state.id upon entering a final child of state, if the parent state is a child of a parallel element, and all of the parallel's other children are also in final states, the Processor MUST generate the event done.state.id where id is the id of the parallel element." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/foreach/test150_test.exs b/test/scxml_tests/mandatory/foreach/test150_test.exs new file mode 100644 index 0000000..e59c0bd --- /dev/null +++ b/test/scxml_tests/mandatory/foreach/test150_test.exs @@ -0,0 +1,54 @@ +defmodule Test.StateChart.W3.Foreach.Test150 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "foreach" + test "test150" do + xml = """ + + + + + + + [1,2,3] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "In the foreach element, the SCXML processor MUST declare a new variable if the one specified by 'item' is not already defined." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/foreach/test151_test.exs b/test/scxml_tests/mandatory/foreach/test151_test.exs new file mode 100644 index 0000000..0639ad1 --- /dev/null +++ b/test/scxml_tests/mandatory/foreach/test151_test.exs @@ -0,0 +1,54 @@ +defmodule Test.StateChart.W3.Foreach.Test151 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "foreach" + test "test151" do + xml = """ + + + + + + + [1,2,3] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "In the foreach element, if 'index' is present, the SCXML processor MUST declare a new variable if the one specified by 'index' is not already defined." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/foreach/test152_test.exs b/test/scxml_tests/mandatory/foreach/test152_test.exs new file mode 100644 index 0000000..bc78ee2 --- /dev/null +++ b/test/scxml_tests/mandatory/foreach/test152_test.exs @@ -0,0 +1,60 @@ +defmodule Test.StateChart.W3.Foreach.Test152 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "foreach" + test "test152" do + xml = """ + + + + + + + + + [1,2,3] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "In the foreach element, if 'array' does not evaluate to a legal iterable collection, or if 'item' does not specify a legal variable name, the SCXML processor MUST terminate execution of the foreach element and the block that contains it, and place the error error.execution on the internal event queue." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/foreach/test153_test.exs b/test/scxml_tests/mandatory/foreach/test153_test.exs new file mode 100644 index 0000000..12aabf9 --- /dev/null +++ b/test/scxml_tests/mandatory/foreach/test153_test.exs @@ -0,0 +1,48 @@ +defmodule Test.StateChart.W3.Foreach.Test153 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "foreach" + test "test153" do + xml = """ + + + + + + + [1,2,3] + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "When evaluating foreach, the SCXML processor MUST start with the first item in the collection and proceed to the last item in the iteration order that is defined for the collection. For each item in the collection in turn, the processor MUST assign it to the item variable." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/foreach/test155_test.exs b/test/scxml_tests/mandatory/foreach/test155_test.exs new file mode 100644 index 0000000..ac11816 --- /dev/null +++ b/test/scxml_tests/mandatory/foreach/test155_test.exs @@ -0,0 +1,43 @@ +defmodule Test.StateChart.W3.Foreach.Test155 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "foreach" + test "test155" do + xml = """ + + + + + + + [1,2,3] + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "when evaluating foreach, for each item, after making the assignment, the SCXML processor MUST evaluate its child executable content. It MUST then proceed to the next item in iteration order." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/foreach/test156_test.exs b/test/scxml_tests/mandatory/foreach/test156_test.exs new file mode 100644 index 0000000..2a77fb8 --- /dev/null +++ b/test/scxml_tests/mandatory/foreach/test156_test.exs @@ -0,0 +1,44 @@ +defmodule Test.StateChart.W3.Foreach.Test156 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "foreach" + test "test156" do + xml = """ + + + + + + + [1,2,3] + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "If the evaluation of any child element of foreach causes an error, the processor MUST cease execution of the foreach element and the block that contains it." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/foreach/test525_test.exs b/test/scxml_tests/mandatory/foreach/test525_test.exs new file mode 100644 index 0000000..df37bd1 --- /dev/null +++ b/test/scxml_tests/mandatory/foreach/test525_test.exs @@ -0,0 +1,43 @@ +defmodule Test.StateChart.W3.Foreach.Test525 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "foreach" + test "test525" do + xml = """ + + + + + [1,2,3] + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "The SCXML processor MUST act as if it has made a shallow copy of the collection produced by the evaluation of 'array'. Specifically, modifications to the collection during the execution of foreach MUST NOT affect the iteration behavior." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/history/test387_test.exs b/test/scxml_tests/mandatory/history/test387_test.exs new file mode 100644 index 0000000..d4a6f50 --- /dev/null +++ b/test/scxml_tests/mandatory/history/test387_test.exs @@ -0,0 +1,104 @@ +defmodule Test.StateChart.W3.History.Test387 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "history" + test "test387" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "Before the parent state has been visited for the first time, if a transition is executed that takes the history state as its target, the SCXML processor MUST behave as if the transition had taken the default stored state configuration as its target." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/history/test388_test.exs b/test/scxml_tests/mandatory/history/test388_test.exs new file mode 100644 index 0000000..e5fcb18 --- /dev/null +++ b/test/scxml_tests/mandatory/history/test388_test.exs @@ -0,0 +1,79 @@ +defmodule Test.StateChart.W3.History.Test388 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "history" + test "test388" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "After the parent state has been visited for the first time, if a transition is executed that takes the history state as its target, the SCXML processor MUST behave as if the transition had taken the stored state configuration as its target." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/history/test579_test.exs b/test/scxml_tests/mandatory/history/test579_test.exs new file mode 100644 index 0000000..d75f227 --- /dev/null +++ b/test/scxml_tests/mandatory/history/test579_test.exs @@ -0,0 +1,74 @@ +defmodule Test.StateChart.W3.History.Test579 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "history" + test "test579" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "Before the parent state has been visited for the first time, if a transition is executed that takes the history state as its target, the SCXML processor MUST execute any executable content in the transition after the parent state's onentry content and any content in a possible initial transition." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/history/test580_test.exs b/test/scxml_tests/mandatory/history/test580_test.exs new file mode 100644 index 0000000..e754776 --- /dev/null +++ b/test/scxml_tests/mandatory/history/test580_test.exs @@ -0,0 +1,61 @@ +defmodule Test.StateChart.W3.History.Test580 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "history" + test "test580" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "It follows from the semantics of history states that they never end up in the state configuration" + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/if/test147_test.exs b/test/scxml_tests/mandatory/if/test147_test.exs new file mode 100644 index 0000000..be9bb61 --- /dev/null +++ b/test/scxml_tests/mandatory/if/test147_test.exs @@ -0,0 +1,47 @@ +defmodule Test.StateChart.W3.If.Test147 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "if" + test "test147" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "When the if element is executed, the SCXML processor MUST execute the first partition in document order that is defined by a tag whose 'cond' attribute evaluates to true, if there is one." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/if/test148_test.exs b/test/scxml_tests/mandatory/if/test148_test.exs new file mode 100644 index 0000000..91822b8 --- /dev/null +++ b/test/scxml_tests/mandatory/if/test148_test.exs @@ -0,0 +1,47 @@ +defmodule Test.StateChart.W3.If.Test148 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "if" + test "test148" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "When the if element is executed, if no 'cond'attribute evaluates to true, the SCXML Processor must execute the partition defined by the else tag, if there is one." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/if/test149_test.exs b/test/scxml_tests/mandatory/if/test149_test.exs new file mode 100644 index 0000000..675e8eb --- /dev/null +++ b/test/scxml_tests/mandatory/if/test149_test.exs @@ -0,0 +1,44 @@ +defmodule Test.StateChart.W3.If.Test149 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "if" + test "test149" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "When it executes an if element, if no 'cond' attribute evaluates to true and there is no else element, the SCXML processor must not evaluate any executable content within the element." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/onentry/test375_test.exs b/test/scxml_tests/mandatory/onentry/test375_test.exs new file mode 100644 index 0000000..3e09a3f --- /dev/null +++ b/test/scxml_tests/mandatory/onentry/test375_test.exs @@ -0,0 +1,41 @@ +defmodule Test.StateChart.W3.Onentry.Test375 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "onentry" + test "test375" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "The SCXML processor MUST execute the onentry handlers of a state in document order when the state is entered." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/onentry/test376_test.exs b/test/scxml_tests/mandatory/onentry/test376_test.exs new file mode 100644 index 0000000..81a00b4 --- /dev/null +++ b/test/scxml_tests/mandatory/onentry/test376_test.exs @@ -0,0 +1,40 @@ +defmodule Test.StateChart.W3.Onentry.Test376 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "onentry" + test "test376" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "The SCXML processor MUST treat each [onentry] handler as a separate block of executable content." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/onexit/test377_test.exs b/test/scxml_tests/mandatory/onexit/test377_test.exs new file mode 100644 index 0000000..715df09 --- /dev/null +++ b/test/scxml_tests/mandatory/onexit/test377_test.exs @@ -0,0 +1,44 @@ +defmodule Test.StateChart.W3.Onexit.Test377 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "onexit" + test "test377" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "The SCXML processor MUST execute the onexit handlers of a state in document order when the state is exited." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/onexit/test378_test.exs b/test/scxml_tests/mandatory/onexit/test378_test.exs new file mode 100644 index 0000000..dcbc570 --- /dev/null +++ b/test/scxml_tests/mandatory/onexit/test378_test.exs @@ -0,0 +1,43 @@ +defmodule Test.StateChart.W3.Onexit.Test378 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "onexit" + test "test378" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "The SCXML processor MUST treat each [onexit] handler as a separate block of executable content." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/raise/test144_test.exs b/test/scxml_tests/mandatory/raise/test144_test.exs new file mode 100644 index 0000000..29506e9 --- /dev/null +++ b/test/scxml_tests/mandatory/raise/test144_test.exs @@ -0,0 +1,39 @@ +defmodule Test.StateChart.W3.Raise.Test144 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "raise" + test "test144" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "The SCXML processor MUST place the event that is generated by the raise element at the rear of the session's internal event queue." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/scxml/test355_test.exs b/test/scxml_tests/mandatory/scxml/test355_test.exs new file mode 100644 index 0000000..7db1f86 --- /dev/null +++ b/test/scxml_tests/mandatory/scxml/test355_test.exs @@ -0,0 +1,33 @@ +defmodule Test.StateChart.W3.Scxml.Test355 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "scxml" + test "test355" do + xml = """ + + + + + + + + + + + + + + + + + + + + """ + + description = + "At system initialization time, if the 'initial' attribute is not present, the Processor MUST enter the first state in document order." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/scxml/test576_test.exs b/test/scxml_tests/mandatory/scxml/test576_test.exs new file mode 100644 index 0000000..5adde1a --- /dev/null +++ b/test/scxml_tests/mandatory/scxml/test576_test.exs @@ -0,0 +1,55 @@ +defmodule Test.StateChart.W3.Scxml.Test576 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "scxml" + test "test576" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "At system initialization time, the SCXML Processor MUST enter the states specified by the 'initial' attribute, if it is present." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/scxml_tests/mandatory/state/test364_test.exs b/test/scxml_tests/mandatory/state/test364_test.exs new file mode 100644 index 0000000..ef9b134 --- /dev/null +++ b/test/scxml_tests/mandatory/state/test364_test.exs @@ -0,0 +1,90 @@ +defmodule Test.StateChart.W3.State.Test364 do + use SC.Case + @tag :scxml_w3 + @tag conformance: "mandatory", spec: "state" + test "test364" do + xml = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + """ + + description = + "Definition: The default initial state(s) of a compound state are those specified by the 'initial' attribute or initial element, if either is present. Otherwise it is the state's first child state in document order. If a compound state is entered either as an initial state or as the target of a transition (i.e. and no descendent of it is specified), then the SCXML Processor MUST enter the default initial state(s) after it enters the parent state." + + test_scxml(xml, description, ["pass"], []) + end +end diff --git a/test/support/sc_case.ex b/test/support/sc_case.ex new file mode 100644 index 0000000..d0605ca --- /dev/null +++ b/test/support/sc_case.ex @@ -0,0 +1,66 @@ +defmodule SC.Case do + @moduledoc """ + Test case template for SCXML state machine testing. + + Provides utilities for testing state machine behavior against both + SCION and W3C test suites using the SC.Interpreter. + """ + + use ExUnit.CaseTemplate, async: true + + alias SC.{Event, Interpreter, Parser.SCXML} + + using do + quote do + import unquote(__MODULE__) + end + end + + @doc """ + Test SCXML state machine behavior. + + - xml: SCXML document string + - description: Test description (for debugging) + - expected_initial_config: List of expected initial active state IDs + - events: List of {event_map, expected_states} tuples + """ + @spec test_scxml(String.t(), String.t(), list(String.t()), list({map(), list(String.t())})) :: + :ok + def test_scxml(xml, _description, expected_initial_config, events) do + # Parse and initialize the state chart + {:ok, document} = SCXML.parse(xml) + {:ok, state_chart} = Interpreter.initialize(document) + + # Verify initial configuration + assert_configuration(state_chart, expected_initial_config) + + # Process events and verify resulting configurations + _final_state_chart = + Enum.reduce(events, state_chart, fn {event_map, expected_states}, current_state_chart -> + # Create event from map (typically has "name" key) + event = Event.new(event_map["name"], event_map) + + # Send event and get new state chart + {:ok, new_state_chart} = Interpreter.send_event(current_state_chart, event) + + # Verify the resulting configuration + assert_configuration(new_state_chart, expected_states) + + new_state_chart + end) + + :ok + end + + defp assert_configuration(state_chart, expected_state_ids) do + expected = MapSet.new(expected_state_ids) + actual = Interpreter.active_states(state_chart) + + # Convert to sorted lists for better error messages + expected_list = expected |> Enum.sort() + actual_list = actual |> Enum.sort() + + assert expected == actual, + "Expected active states #{inspect(expected_list)}, but got #{inspect(actual_list)}" + end +end diff --git a/test/test_helper.exs b/test/test_helper.exs new file mode 100644 index 0000000..743cd46 --- /dev/null +++ b/test/test_helper.exs @@ -0,0 +1 @@ +ExUnit.start(exclude: [:scion, :scxml_w3])