-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow input syntax to support commands
- Loading branch information
1 parent
fc3d846
commit b0f0ae3
Showing
9 changed files
with
75 additions
and
29 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
domain foo { | ||
command DoIt is { what_to_do: String } | ||
application input_tests is { | ||
page top is { | ||
button pressMe initiates command DoIt | ||
} | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
language/src/test/scala/com/reactific/riddl/language/parsing/SnippetsFileTest.scala
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.reactific.riddl.language.parsing | ||
|
||
import com.reactific.riddl.language.Messages.Messages | ||
import com.reactific.riddl.language.ParsingTest | ||
|
||
import java.nio.file.Path | ||
import org.apache.commons.io.FileUtils | ||
|
||
import java.io.File | ||
import scala.jdk.CollectionConverters.* | ||
|
||
/** Parsing tests that try a variety of code snippets that should parse */ | ||
class SnippetsFileTest extends ParsingTest { | ||
|
||
val topDir = Path.of(s"language/src/test/input/snippets") | ||
val files: Iterable[File] = FileUtils.listFiles(topDir.toFile, Array("riddl"), true).asScala | ||
"Snippet Files" should { | ||
"app parse correctly" in { | ||
for {file <- files} do | ||
info(s"File: $file") | ||
val input = RiddlParserInput(file) | ||
parseTopLevelDomains(input) match | ||
case Left(msgs: Messages) => | ||
fail(msgs.format) | ||
case Right(root) => | ||
succeed | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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