feat: run example files as tests to catch regressions like #266

Add a new `run_example` function that invokes the existing test runner with an `example=True` flag, and walk the `example/` and `example/import-module/` directories to execute all example files as tests. The `example` flag suppresses output comparison against expected lines, allowing examples that produce arbitrary output (or none) to pass without failure. Also comment out `foreign static bar` and `foreign baz(string)` in `example/syntax.wren` to prevent compilation errors when running it as a test.
This commit is contained in:
Kyle Marek-Spartz
2015-05-20 15:10:40 +00:00
parent 38125a9cfe
commit 309446fca2
2 changed files with 11 additions and 4 deletions
+2 -2
View File
@@ -90,8 +90,8 @@ class ReservedWords is SyntaxExample {
}
// `foreign`, `static`
foreign static bar
foreign baz(string)
// foreign static bar
// foreign baz(string)
// (Remove lines above to make this file compile)
}