Repository navigation
Add VisuStructCore tests and CI workflow - #8
Merged
Merged
Conversation
Tests cover loading, round-tripping and code generation for every example
diagram in VisuStruct-Dateien, simulation of the Collatz, Fibonacci and
NumberEven examples plus loops, switch, conditions and errors, and the
Java class export against the shipped .java files.
Also fixes sanitizedJavaClassName returning a name that starts with a
digit ("2 Summe" -> "2_Summe"), which is not a valid Java class name.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cp4EQgFQyGbM8MVLiWbJKQ
The test fed plain text, but .visustruct/.strk store text as semicolon-separated code points, so it decoded to empty strings. It had never run before CI existed. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Cp4EQgFQyGbM8MVLiWbJKQ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Holger · project thread
Before:
VisuStructCorehad one test (decoding a tiny XML snippet) and nothing ran it automatically.After:
swift testruns on every pull request and every push tomain(macOS runner), and checks the simulator, the code generators and the XML codec against the example diagrams inVisuStruct-Dateien.What the tests cover:
.visustructexample loads, survives save + reload unchanged, and produces non-empty Java, Python and JavaScript.&&/||/!=, rejected input and division by zero..javafiles; Python/JS output for Collatz has the expected loop and print lines.Fixes found along the way:
sanitizedJavaClassName: a title starting with a digit ("2 Summe") produced2_Summe, which is not a valid Java class name; it now yields_2_Summe.;-separated code points, so it had been failing silently (it never ran before). It now uses the encoded form.How: shared helpers in
TestSupport.swiftlocateVisuStruct-Dateienvia#filePathand drive the simulation engine to completion, feeding inputs.🤖 Generated with Claude Code
https://claude.ai/code/session_01Cp4EQgFQyGbM8MVLiWbJKQ