Add stuff so that we can at least run the README as a test suite.
Cat's Eye Technologies
12 years ago
11 | 11 |
Falderal format. The design of Velo is still somewhat inchoate,
|
12 | 12 |
so do not expect all of these examples to be perfectly consistent
|
13 | 13 |
or even necessarily feasible.
|
|
14 |
|
|
15 |
-> Tests for functionality "Interpret Velo Script"
|
14 | 16 |
|
15 | 17 |
First, the ubiquitous "Hello, world!":
|
16 | 18 |
|
|
58 | 60 |
that you necessarily take a performance hit.
|
59 | 61 |
|
60 | 62 |
| extend {IO}
|
61 | |
| a = input;
|
|
63 |
| a = {7}.concat {>}.concat {5}
|
62 | 64 |
| a.if {print {Yes}}, {print {No}}
|
63 | |
+ 5 > 4
|
64 | 65 |
= Yes
|
65 | 66 |
|
66 | 67 |
Scripts as Classes
|
|
0 |
#!/usr/bin/env ruby
|
|
1 |
|
|
2 |
# This is just a stub that always fails for now, so that we can at least
|
|
3 |
# run the tests defined in the README.
|
|
4 |
|
|
5 |
# (Part of me is also thinking it's a bad idea to try to implement Velo
|
|
6 |
# in Ruby, but for now, why not.)
|
|
7 |
|
|
8 |
ARGV.each do |filename|
|
|
9 |
end
|
|
10 |
|
|
11 |
$stderr.puts "I fail"
|
|
12 |
exit false
|
|
0 |
#!/bin/sh
|
|
1 |
|
|
2 |
falderal test tests/config/Velo.markdown README.markdown
|
|
0 |
Testing Velo scripts on Velo reference interpreter
|
|
1 |
|
|
2 |
-> Functionality "Interpret Velo Script" is implemented by shell command
|
|
3 |
-> "src/velo.rb %(test-file)"
|