Compare commits

...

10 Commits

Author SHA1 Message Date
András B Nagy
dbfe69ed8c Pin CI to specific Arturo nightly (#179)
Some checks failed
Configlet / configlet (push) Has been cancelled
Test / ci (push) Has been cancelled
Tools / sync-labels (push) Has been cancelled
* Pin CI to same nightly as test runner
2025-10-29 20:52:41 -07:00
Glenn Jackman
1735fc16cd Tournament: change the unicode medium vertical bars back to ascii vertical bars (#216) 2025-10-29 19:04:33 -07:00
Glenn Jackman
7ece698826 some usability improvements to verify-exercises script (#214) 2025-10-29 12:22:22 -07:00
Glenn Jackman
9cffe1a402 Update unitt version for line-up exercise (#215) 2025-10-29 10:56:01 -07:00
András B Nagy
6618e61587 Revert invalidator comment to force invalidation (#212) 2025-10-28 16:49:38 -07:00
András B Nagy
8d1e23c238 Prepare for a mass invalidation of existing solutions (#211) 2025-10-28 16:43:07 -07:00
András B Nagy
393fd50074 Fix Unitt installation command in TESTS.md (#210)
Corrected the installation command for Unitt in the documentation.
2025-10-28 15:50:35 -07:00
András B Nagy
6133a86edb Update docs for unitt 3 (#209)
* Bump unitt version number

* Remove no longer relevant `express` info

* Update test output examples

* Add note about pre-installing unitt
2025-10-25 22:53:58 -07:00
András B Nagy
23c5f3a9ec Upgrade track to unitt 3 (#208)
[no important files changed]
2025-10-25 22:49:44 -07:00
András B Nagy
c9536ab350 Make CI compatible for Unitt 3.x (#207)
* Ignore auto-generated .unitt folders

* Update `acronym` to unitt 3

* Only show detailed output for failing CI tests

* Revert "Update `acronym` to unitt 3"

This reverts commit c4972099e3133ed623cbf8c2131310a07fb5f29c.
2025-10-20 23:04:31 -07:00
224 changed files with 1960 additions and 1352 deletions

View File

@@ -18,12 +18,18 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install libgtk-3-dev libwebkit2gtk-4.1-dev libmpfr-dev
sudo apt-get install libmpfr6 libwebkit2gtk-4.1-0 libpcre3
- name: Install Arturo
uses: arturo-lang/arturo-action@main
with:
token: ${{ github.token }}
run: |
curl -L -o arturo.zip https://github.com/arturo-lang/nightly/releases/download/2025-10-14/arturo-nightly.2025-10-13-amd64-linux-full.zip
sudo unzip arturo.zip -d /usr/local/bin/
rm arturo.zip
sudo chmod +x /usr/local/bin/arturo
sudo ldconfig
- name: Install Unitt testing framework
run: arturo -p install unitt 3.0.0
- name: Verify all exercises
run: bin/verify-exercises

1
.gitignore vendored
View File

@@ -2,3 +2,4 @@
.DS_Store
bin/configlet
bin/configlet.exe
exercises/**/.unitt/

View File

@@ -46,14 +46,25 @@ fi
./bin/fetch-configlet
./bin/configlet create --practice-exercise "${slug}" --author "${author}" --difficulty "${difficulty}"
cat << END_TESTER > "exercises/practice/${slug}/tester.art"
import.version:2.0.1 {unitt}!
cat << END_UNITT_TOML > "exercises/practice/${slug}/unitt.toml"
# unitt.toml - Configuration for unitt
runTests.failFast findTests "tests"
path = "tests"
suffix = ".art"
END_UNITT_TOML
cat << END_TESTER > "exercises/practice/${slug}/tester.art"
exe: switch "windows" = sys\os
-> "unitt.bat"
-> "unitt"
fullpath: normalize ~"|path\home|/.arturo/packages/bin/|exe|"
code: execute.code.directly ~"|fullpath|"
panic.unstyled.code: code ""
END_TESTER
cat << END_TEST > "exercises/practice/${slug}/tests/test-${slug}.art"
import.version:2.0.1 {unitt}!
import.version:3.0.0 {unitt}!
import {src/${slug}}!
$(curl --silent "https://raw.githubusercontent.com/exercism/problem-specifications/main/exercises/${slug}/canonical-data.json")

View File

@@ -12,6 +12,11 @@
set -eo pipefail
usage() {
echo "usage: ${0##*/} [-h] [-v] [exercise-slug]"
echo "where: -v is verbose: show test output even for passing tests"
}
die() { echo "$*" >&2; exit 1; }
required_tool() {
@@ -22,7 +27,7 @@ required_tool() {
required_tool jq
required_tool arturo
copy_example_or_examplar_to_solution() {
copy_example_or_exemplar_to_solution() {
jq -c '[.files.solution, .files.exemplar // .files.example] | transpose | map({src: .[1], dst: .[0]}) | .[]' .meta/config.json \
| while read -r src_and_dst; do
cp "$(jq -r '.src' <<< "${src_and_dst}")" "$(jq -r '.dst' <<< "${src_and_dst}")"
@@ -30,13 +35,32 @@ copy_example_or_examplar_to_solution() {
}
unskip_tests() {
jq -r '.files.test[]' .meta/config.json | while read -r test_file; do
sed -i -E 's/(test|it).skip/\1/g' "${test_file}"
done
while read -r test_file; do
perl -i -pe 's/(test|it).skip/\1/g' "${test_file}"
done < <(
jq -r '.files.test[]' .meta/config.json
)
}
run_tests() {
arturo tester.art
set +e
test_output=$(arturo tester.art 2>&1)
result=$?
set -e
# unitt v3 bug workaround
if [[ $result -eq 0 && $test_output == "Uncaught error in tests"* ]]; then
result=1
fi
if [[ $result -eq 0 ]]; then
$verbose && echo "${test_output}" && echo
echo "All tests passed!"
return 0
else
echo "${test_output}"
return 1
fi
}
verify_exercise() {
@@ -55,7 +79,7 @@ verify_exercise() {
cp -r "${dir}/." "${tmp_dir}"
cd "${tmp_dir}"
copy_example_or_examplar_to_solution
copy_example_or_exemplar_to_solution
unskip_tests
run_tests
)
@@ -77,5 +101,15 @@ verify_exercises() {
((count > 0)) || die 'no matching exercises found!'
}
verbose=false
while getopts :hv opt; do
case $opt in
h) usage; exit 0;;
v) verbose=true ;;
*) usage; exit 1;;
esac
done
shift $((OPTIND - 1))
exercise_slug="${1:-*}"
verify_exercises "${exercise_slug}"

View File

@@ -2,9 +2,8 @@
The Arturo track uses the [Unitt unit-testing package][unitt] for all exercise tests.
This package provides a testng framework supporting both modern RSpec-inspired syntax and legacy XUnit-inspired syntax.
Arturo will automatically download and install this package when you run the tests, requiring minimal setup.
To begin running tests, you can use `arturo tester.art` or `exercism test` within the exercise folder.
Locally, you must first install Unitt 3 by running `arturo --package install unitt 3.0.0`.
At that point, you can use `arturo tester.art` or `exercism test` to run your tests within the exercise folder.
Only the first test will be run and reported back to you.
Once that test passes, unskip the next one and run the tests again until each test passes.
For both the RSpec and XUnit setups, that's as simple as removing `.skip` from `it.skip` or `test.skip` respectively.
@@ -41,7 +40,7 @@ Remove the `panic` line and then begin coding your implementation for `isLeap?`.
## RSpec Test Structure
```arturo
import.version:2.0.1 {unitt}!
import.version:3.0.0 {unitt}!
import {src/leap}!
describe "Leap" [
@@ -63,14 +62,6 @@ In `expects.be:'false? @[isLeap? 2015]`, the test suite is making an assertion t
Another way to write that is `expects.be:'equal? @[false isLeapYear? 2015]` where we're asserting the returned vaue of `isLeapYear? 2015` is equal to `false`.
This longer form comparing two values is the most common type of assertion on the Arturo track.
The expected value will always come first in the block before the result value.
Notably, `express <value>` is used sometimes to add quotes at the beginning and end of strings, like `expects.be:'equal? @[express "reward" express reverseString "drawer"]`.
To help readability, this will typically be split across multiple lines like this:
```arturo
expects.be:'equal? @[
express "reward"
express reverseString "drawer"
]
```
## XUnit Test Structure
@@ -106,24 +97,29 @@ RSpec, however, reports it as `false? false` because we used the `false?` functi
Starting at the beginning, Arturo will report an error if the `panic` from the starting file hasm't been removed and not evaluate any tests.
```
===== tests/test-leap.art =====
Uncaught error in tests/test-leap.art:
#[
output: {
══╡ Program Error ╞═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════ <script> ══
Please implement the isLeap? function
}
code: 1
]
Description: Leap
══╡ Program Error ╞═════════════════════════════════════════════════════════════════════════════════════════════════ <script> ══
please implement the isLeap? function
```
Once the `panic` is replaced, Arturo will report the status for each assertion made within a test.
Now the first test passes, but the second test is skipped.
```plaintext
===== tests/test-leap.art =====
======== .unitt/tests/test-leap.art ========
Describe: Leap
Description: Leap
✅ - assert that a year not divisible by 4 is a common year
✅: false? false
@@ -131,25 +127,24 @@ Description: Leap
skipped!
========== Summary ==========
===== Statistics =====
⏏️ TOTAL: 2 assertions
✅ PASSED: 1 assertion
⏩ SKIPPED: 1 assertion
❌ FAILED: 0 assertion
⏏️ TOTAL: 1 assertions
✅ PASSED: 1 assertions
⏩ SKIPPED: 1 assertions
❌ FAILED: 0 assertions
===== ========== =====
========== ======= ==========
```
After the second test is manually unskipped, both tests will be run.
However, my code only returns `false` so the second test fails its assertion.
However, the current isLeap? code implementation only returns `false` so the second test fails its assertion.
```plaintext
===== tests/test-leap.art =====
======== .unitt/tests/test-leap.art ========
Describe: Leap
Description: Leap
✅ - assert that a year not divisible by 4 is a common year
✅: false? false
@@ -157,15 +152,14 @@ Description: Leap
❌: true? false
========== Summary ==========
===== Statistics =====
⏏️ TOTAL: 2 assertions
✅ PASSED: 1 assertion
⏩ SKIPPED: 0 assertion
❌ FAILED: 1 assertion
⏏️ TOTAL: 2 assertions
✅ PASSED: 1 assertions
⏩ SKIPPED: 0 assertions
❌ FAILED: 1 assertions
===== ========== =====
========== ======= ==========
```
This process will continue as you unskip more tests.

View File

@@ -1,3 +1,7 @@
import.version:2.0.1 {unitt}!
exe: switch "windows" = sys\os
-> "unitt.bat"
-> "unitt"
runTests.failFast findTests "tests"
fullpath: normalize ~"|path\home|/.arturo/packages/bin/|exe|"
code: execute.code.directly ~"|fullpath|"
panic.unstyled.code: code ""

View File

@@ -1,76 +1,76 @@
import.version:2.0.1 {unitt}!
import.version:3.0.0 {unitt}!
import {src/acronym}!
describe "Acronym" [
it "basic" [
phrase: "Portable Network Graphics"
expects.be: 'equal? @[
express "PNG"
express abbreviate phrase
"PNG"
abbreviate phrase
]
]
it.skip "lowercase words" [
phrase: "Ruby on Rails"
expects.be: 'equal? @[
express "ROR"
express abbreviate phrase
"ROR"
abbreviate phrase
]
]
it.skip "punctuation" [
phrase: "First In, First Out"
expects.be: 'equal? @[
express "FIFO"
express abbreviate phrase
"FIFO"
abbreviate phrase
]
]
it.skip "all uppercase word" [
phrase: "GNU Image Manipulation Program"
expects.be: 'equal? @[
express "GIMP"
express abbreviate phrase
"GIMP"
abbreviate phrase
]
]
it.skip "punctuation without whitespace" [
phrase: "Complementary metal-oxide semiconductor"
expects.be: 'equal? @[
express "CMOS"
express abbreviate phrase
"CMOS"
abbreviate phrase
]
]
it.skip "very long abbreviation" [
phrase: "Rolling On The Floor Laughing So Hard That My Dogs Came Over And Licked Me"
expects.be: 'equal? @[
express "ROTFLSHTMDCOALM"
express abbreviate phrase
"ROTFLSHTMDCOALM"
abbreviate phrase
]
]
it.skip "consecutive delimiters" [
phrase: "Something - I made up from thin air"
expects.be: 'equal? @[
express "SIMUFTA"
express abbreviate phrase
"SIMUFTA"
abbreviate phrase
]
]
it.skip "apostrophes" [
phrase: "Halley\'s Comet"
expects.be: 'equal? @[
express "HC"
express abbreviate phrase
"HC"
abbreviate phrase
]
]
it.skip "underscore emphasis" [
phrase: "The Road _Not_ Taken"
expects.be: 'equal? @[
express "TRNT"
express abbreviate phrase
"TRNT"
abbreviate phrase
]
]
]

View File

@@ -0,0 +1,4 @@
# unitt.toml - Configuration for unitt
path = "tests"
suffix = ".art"

View File

@@ -1,3 +1,7 @@
import.version:2.0.1 {unitt}!
exe: switch "windows" = sys\os
-> "unitt.bat"
-> "unitt"
runTests.failFast findTests "tests"
fullpath: normalize ~"|path\home|/.arturo/packages/bin/|exe|"
code: execute.code.directly ~"|fullpath|"
panic.unstyled.code: code ""

View File

@@ -1,4 +1,4 @@
import.version:2.0.1 {unitt}!
import.version:3.0.0 {unitt}!
import {src/allergies}!
describe "Allergies" [

View File

@@ -0,0 +1,4 @@
# unitt.toml - Configuration for unitt
path = "tests"
suffix = ".art"

View File

@@ -1,3 +1,7 @@
import.version:2.0.1 {unitt}!
exe: switch "windows" = sys\os
-> "unitt.bat"
-> "unitt"
runTests.failFast findTests "tests"
fullpath: normalize ~"|path\home|/.arturo/packages/bin/|exe|"
code: execute.code.directly ~"|fullpath|"
panic.unstyled.code: code ""

View File

@@ -1,39 +1,39 @@
import.version:2.0.1 {unitt}!
import.version:3.0.0 {unitt}!
import {src/anagram}!
describe "Anagram" [
it "no matches" [
expects.be:'equal? @[
express []
express findAnagrams "diaper" ["hello" "world" "zombies" "pants"]
[]
findAnagrams "diaper" ["hello" "world" "zombies" "pants"]
]
]
it.skip "detects two anagrams" [
expects.be:'equal? @[
express ["lemons" "melons"]
express findAnagrams "solemn" ["lemons" "cherry" "melons"]
["lemons" "melons"]
findAnagrams "solemn" ["lemons" "cherry" "melons"]
]
]
it.skip "does not detect anagram subsets" [
expects.be:'equal? @[
express []
express findAnagrams "good" ["dog" "goody"]
[]
findAnagrams "good" ["dog" "goody"]
]
]
it.skip "detects anagram" [
expects.be:'equal? @[
express ["inlets"]
express findAnagrams "listen" ["enlists" "google" "inlets" "banana"]
["inlets"]
findAnagrams "listen" ["enlists" "google" "inlets" "banana"]
]
]
it.skip "detects three anagrams" [
expects.be:'equal? @[
express ["gallery" "regally" "largely"]
express findAnagrams "allergy" ["gallery" "ballerina"
["gallery" "regally" "largely"]
findAnagrams "allergy" ["gallery" "ballerina"
"regally" "clergy"
"largely" "leading"]
]
@@ -41,78 +41,78 @@ describe "Anagram" [
it.skip "detects multiple anagrams with different case" [
expects.be:'equal? @[
express ["Eons" "ONES"]
express findAnagrams "nose" ["Eons" "ONES"]
["Eons" "ONES"]
findAnagrams "nose" ["Eons" "ONES"]
]
]
it.skip "does not detect non-anagrams with identical checksum" [
expects.be:'equal? @[
express []
express findAnagrams "mass" ["last"]
[]
findAnagrams "mass" ["last"]
]
]
it.skip "detects anagrams case-insensitively" [
expects.be:'equal? @[
express ["Carthorse"]
express findAnagrams "Orchestra" ["cashregister" "Carthorse" "radishes"]
["Carthorse"]
findAnagrams "Orchestra" ["cashregister" "Carthorse" "radishes"]
]
]
it.skip "detects anagrams using case-insensitive subject" [
expects.be:'equal? @[
express ["carthorse"]
express findAnagrams "Orchestra" ["cashregister" "carthorse" "radishes"]
["carthorse"]
findAnagrams "Orchestra" ["cashregister" "carthorse" "radishes"]
]
]
it.skip "detects anagrams using case-insensitive possible matches" [
expects.be:'equal? @[
express ["Carthorse"]
express findAnagrams "orchestra" ["cashregister" "Carthorse" "radishes"]
["Carthorse"]
findAnagrams "orchestra" ["cashregister" "Carthorse" "radishes"]
]
]
it.skip "does not detect an anagram if the original word is repeated" [
expects.be:'equal? @[
express []
express findAnagrams "go" ["goGoGO"]
[]
findAnagrams "go" ["goGoGO"]
]
]
it.skip "anagrams must use all letters exactly once" [
expects.be:'equal? @[
express []
express findAnagrams "tapper" ["patter"]
[]
findAnagrams "tapper" ["patter"]
]
]
it.skip "words are not anagrams of themselves" [
expects.be:'equal? @[
express []
express findAnagrams "BANANA" ["BANANA"]
[]
findAnagrams "BANANA" ["BANANA"]
]
]
it.skip "words are not anagrams of themselves even if letter case is partially different" [
expects.be:'equal? @[
express []
express findAnagrams "BANANA" ["Banana"]
[]
findAnagrams "BANANA" ["Banana"]
]
]
it.skip "words are not anagrams of themselves even if letter case is completely different" [
expects.be:'equal? @[
express []
express findAnagrams "BANANA" ["banana"]
[]
findAnagrams "BANANA" ["banana"]
]
]
it.skip "words other than themselves can be anagrams" [
expects.be:'equal? @[
express ["Silent"]
express findAnagrams "LISTEN" ["Listen" "Silent" "LISTEN"]
["Silent"]
findAnagrams "LISTEN" ["Listen" "Silent" "LISTEN"]
]
]
@@ -125,8 +125,8 @@ describe "Anagram" [
it.skip "different characters may have the same bytes" [
expects.be:'equal? @[
express []
express findAnagrams "a⬂" ["€a"]
[]
findAnagrams "a⬂" ["€a"]
]
]
]

View File

@@ -0,0 +1,4 @@
# unitt.toml - Configuration for unitt
path = "tests"
suffix = ".art"

View File

@@ -1,3 +1,7 @@
import.version:2.0.1 {unitt}!
exe: switch "windows" = sys\os
-> "unitt.bat"
-> "unitt"
runTests.failFast findTests "tests"
fullpath: normalize ~"|path\home|/.arturo/packages/bin/|exe|"
code: execute.code.directly ~"|fullpath|"
panic.unstyled.code: code ""

View File

@@ -1,4 +1,4 @@
import.version:2.0.1 {unitt}!
import.version:3.0.0 {unitt}!
import {src/armstrong-numbers}!
describe "Armstrong Numbers" [

View File

@@ -0,0 +1,4 @@
# unitt.toml - Configuration for unitt
path = "tests"
suffix = ".art"

View File

@@ -1,3 +1,7 @@
import.version:2.0.1 {unitt}!
exe: switch "windows" = sys\os
-> "unitt.bat"
-> "unitt"
runTests.failFast findTests "tests"
fullpath: normalize ~"|path\home|/.arturo/packages/bin/|exe|"
code: execute.code.directly ~"|fullpath|"
panic.unstyled.code: code ""

View File

@@ -1,61 +1,61 @@
import.version:2.0.1 {unitt}!
import.version:3.0.0 {unitt}!
import {src/atbash-cipher}!
describe "Atbash Cipher" [
describe "Atbash Cipher - Encode" [
it "encode yes" [
expects.be:'equal? @[
express "bvh"
express encode "yes"
"bvh"
encode "yes"
]
]
it.skip "encode no" [
expects.be:'equal? @[
express "ml"
express encode "no"
"ml"
encode "no"
]
]
it.skip "encode OMG" [
expects.be:'equal? @[
express "lnt"
express encode "OMG"
"lnt"
encode "OMG"
]
]
it.skip "encode spaces" [
expects.be:'equal? @[
express "lnt"
express encode "O M G"
"lnt"
encode "O M G"
]
]
it.skip "encode mindblowingly" [
expects.be:'equal? @[
express "nrmwy oldrm tob"
express encode "mindblowingly"
"nrmwy oldrm tob"
encode "mindblowingly"
]
]
it.skip "encode numbers" [
expects.be:'equal? @[
express "gvhgr mt123 gvhgr mt"
express encode "Testing,1 2 3, testing."
"gvhgr mt123 gvhgr mt"
encode "Testing,1 2 3, testing."
]
]
it.skip "encode deep thought" [
expects.be:'equal? @[
express "gifgs rhurx grlm"
express encode "Truth is fiction."
"gifgs rhurx grlm"
encode "Truth is fiction."
]
]
it.skip "encode all the letters" [
expects.be:'equal? @[
express "gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt"
express encode "The quick brown fox jumps over the lazy dog."
"gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt"
encode "The quick brown fox jumps over the lazy dog."
]
]
]
@@ -63,43 +63,43 @@ describe "Atbash Cipher" [
describe "Atbash Cipher - Decode" [
it.skip "decode exercism" [
expects.be:'equal? @[
express "exercism"
express decode "vcvix rhn"
"exercism"
decode "vcvix rhn"
]
]
it.skip "decode a sentence" [
expects.be:'equal? @[
express "anobstacleisoftenasteppingstone"
express decode "zmlyh gzxov rhlug vmzhg vkkrm thglm v"
"anobstacleisoftenasteppingstone"
decode "zmlyh gzxov rhlug vmzhg vkkrm thglm v"
]
]
it.skip "decode numbers" [
expects.be:'equal? @[
express "testing123testing"
express decode "gvhgr mt123 gvhgr mt"
"testing123testing"
decode "gvhgr mt123 gvhgr mt"
]
]
it.skip "decode all the letters" [
expects.be:'equal? @[
express "thequickbrownfoxjumpsoverthelazydog"
express decode "gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt"
"thequickbrownfoxjumpsoverthelazydog"
decode "gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt"
]
]
it.skip "decode with too many spaces" [
expects.be:'equal? @[
express "exercism"
express decode "vc vix r hn"
"exercism"
decode "vc vix r hn"
]
]
it.skip "decode with no spaces" [
expects.be:'equal? @[
express "anobstacleisoftenasteppingstone"
express decode "zmlyhgzxovrhlugvmzhgvkkrmthglmv"
"anobstacleisoftenasteppingstone"
decode "zmlyhgzxovrhlugvmzhgvkkrmthglmv"
]
]
]

View File

@@ -0,0 +1,4 @@
# unitt.toml - Configuration for unitt
path = "tests"
suffix = ".art"

View File

@@ -1,3 +1,7 @@
import.version:2.0.1 {unitt}!
exe: switch "windows" = sys\os
-> "unitt.bat"
-> "unitt"
runTests.failFast findTests "tests"
fullpath: normalize ~"|path\home|/.arturo/packages/bin/|exe|"
code: execute.code.directly ~"|fullpath|"
panic.unstyled.code: code ""

View File

@@ -1,4 +1,4 @@
import.version:2.0.1 {unitt}!
import.version:3.0.0 {unitt}!
import {src/binary-search}!
describe "Binary Search" [

View File

@@ -0,0 +1,4 @@
# unitt.toml - Configuration for unitt
path = "tests"
suffix = ".art"

View File

@@ -1,3 +1,7 @@
import.version:2.0.1 {unitt}!
exe: switch "windows" = sys\os
-> "unitt.bat"
-> "unitt"
runTests.failFast findTests "tests"
fullpath: normalize ~"|path\home|/.arturo/packages/bin/|exe|"
code: execute.code.directly ~"|fullpath|"
panic.unstyled.code: code ""

View File

@@ -1,179 +1,179 @@
import.version:2.0.1 {unitt}!
import.version:3.0.0 {unitt}!
import {src/bob}!
describe "Bob" [
it "stating something" [
expects.be:'equal? @[
express "Whatever."
express response "Tom-ay-to, tom-aaaah-to."
"Whatever."
response "Tom-ay-to, tom-aaaah-to."
]
]
it.skip "shouting" [
expects.be:'equal? @[
express "Whoa, chill out!"
express response "WATCH OUT!"
"Whoa, chill out!"
response "WATCH OUT!"
]
]
it.skip "shouting gibberish" [
expects.be:'equal? @[
express "Whoa, chill out!"
express response "FCECDFCAAB"
"Whoa, chill out!"
response "FCECDFCAAB"
]
]
it.skip "asking a question" [
expects.be:'equal? @[
express "Sure."
express response "Does this cryogenic chamber make me look fat?"
"Sure."
response "Does this cryogenic chamber make me look fat?"
]
]
it.skip "asking a numeric question" [
expects.be:'equal? @[
express "Sure."
express response "You are, what, like 15?"
"Sure."
response "You are, what, like 15?"
]
]
it.skip "asking gibberish" [
expects.be:'equal? @[
express "Sure."
express response "fffbbcbeab?"
"Sure."
response "fffbbcbeab?"
]
]
it.skip "talking forcefully" [
expects.be:'equal? @[
express "Whatever."
express response "Let's go make out behind the gym!"
"Whatever."
response "Let's go make out behind the gym!"
]
]
it.skip "using acronyms in regular speech" [
expects.be:'equal? @[
express "Whatever."
express response "It's OK if you don't want to go to the DMV."
"Whatever."
response "It's OK if you don't want to go to the DMV."
]
]
it.skip "forceful question" [
expects.be:'equal? @[
express "Calm down, I know what I'm doing!"
express response "WHAT THE HELL WERE YOU THINKING?"
"Calm down, I know what I'm doing!"
response "WHAT THE HELL WERE YOU THINKING?"
]
]
it.skip "shouting numbers" [
expects.be:'equal? @[
express "Whoa, chill out!"
express response "1, 2, 3 GO!"
"Whoa, chill out!"
response "1, 2, 3 GO!"
]
]
it.skip "no letters" [
expects.be:'equal? @[
express "Whatever."
express response "1, 2, 3"
"Whatever."
response "1, 2, 3"
]
]
it.skip "question with no letters" [
expects.be:'equal? @[
express "Sure."
express response "4?"
"Sure."
response "4?"
]
]
it.skip "shouting with special characters" [
expects.be:'equal? @[
express "Whoa, chill out!"
express response "ZOMG THE %^*@#$(*^ ZOMBIES ARE COMING!!11!!1!"
"Whoa, chill out!"
response "ZOMG THE %^*@#$(*^ ZOMBIES ARE COMING!!11!!1!"
]
]
it.skip "shouting with no exclamation mark" [
expects.be:'equal? @[
express "Whoa, chill out!"
express response "I HATE YOU"
"Whoa, chill out!"
response "I HATE YOU"
]
]
it.skip "statement containing question mark" [
expects.be:'equal? @[
express "Whatever."
express response "Ending with ? means a question."
"Whatever."
response "Ending with ? means a question."
]
]
it.skip "non-letters with question" [
expects.be:'equal? @[
express "Sure."
express response ":) ?"
"Sure."
response ":) ?"
]
]
it.skip "prattling on" [
expects.be:'equal? @[
express "Sure."
express response "Wait! Hang on. Are you going to be OK?"
"Sure."
response "Wait! Hang on. Are you going to be OK?"
]
]
it.skip "silence" [
expects.be:'equal? @[
express "Fine. Be that way!"
express response ""
"Fine. Be that way!"
response ""
]
]
it.skip "prolonged silence" [
expects.be:'equal? @[
express "Fine. Be that way!"
express response " "
"Fine. Be that way!"
response " "
]
]
it.skip "alternate silence" [
expects.be:'equal? @[
express "Fine. Be that way!"
express response "\t\t\t\t\t\t\t\t\t\t"
"Fine. Be that way!"
response "\t\t\t\t\t\t\t\t\t\t"
]
]
it.skip "starting with whitespace" [
expects.be:'equal? @[
express "Whatever."
express response " hmmmmmmm..."
"Whatever."
response " hmmmmmmm..."
]
]
it.skip "ending with whitespace" [
expects.be:'equal? @[
express "Sure."
express response "Okay if like my spacebar quite a bit? "
"Sure."
response "Okay if like my spacebar quite a bit? "
]
]
it.skip "other whitespace" [
expects.be:'equal? @[
express "Fine. Be that way!"
express response "\n\r \t"
"Fine. Be that way!"
response "\n\r \t"
]
]
it.skip "non-question ending with whitespace" [
expects.be:'equal? @[
express "Whatever."
express response "This is a statement ending with whitespace "
"Whatever."
response "This is a statement ending with whitespace "
]
]
it.skip "multiple line question" [
expects.be:'equal? @[
express "Sure."
express response "\nDoes this cryogenic chamber make\n me look fat?"
"Sure."
response "\nDoes this cryogenic chamber make\n me look fat?"
]
]
]

View File

@@ -0,0 +1,4 @@
# unitt.toml - Configuration for unitt
path = "tests"
suffix = ".art"

View File

@@ -1,3 +1,7 @@
import.version:2.0.1 {unitt}!
exe: switch "windows" = sys\os
-> "unitt.bat"
-> "unitt"
runTests.failFast findTests "tests"
fullpath: normalize ~"|path\home|/.arturo/packages/bin/|exe|"
code: execute.code.directly ~"|fullpath|"
panic.unstyled.code: code ""

View File

@@ -1,4 +1,4 @@
import.version:2.0.1 {unitt}!
import.version:3.0.0 {unitt}!
import {src/bottle-song}!
describe "Bottle Song" [
@@ -11,8 +11,8 @@ describe "Bottle Song" [
There'll be nine green bottles hanging on the wall.
}
expects.be:'equal? @[
express expected
express recite 10 1
expected
recite 10 1
]
]
@@ -24,8 +24,8 @@ describe "Bottle Song" [
There'll be two green bottles hanging on the wall.
}
expects.be:'equal? @[
express expected
express recite 3 1
expected
recite 3 1
]
]
@@ -37,8 +37,8 @@ describe "Bottle Song" [
There'll be one green bottle hanging on the wall.
}
expects.be:'equal? @[
express expected
express recite 2 1
expected
recite 2 1
]
]
@@ -50,8 +50,8 @@ describe "Bottle Song" [
There'll be no green bottles hanging on the wall.
}
expects.be:'equal? @[
express expected
express recite 1 1
expected
recite 1 1
]
]
]
@@ -70,8 +70,8 @@ describe "Bottle Song" [
There'll be eight green bottles hanging on the wall.
}
expects.be:'equal? @[
express expected
express recite 10 2
expected
recite 10 2
]
]
@@ -93,8 +93,8 @@ describe "Bottle Song" [
There'll be no green bottles hanging on the wall.
}
expects.be:'equal? @[
express expected
express recite 3 3
expected
recite 3 3
]
]
@@ -151,8 +151,8 @@ describe "Bottle Song" [
There'll be no green bottles hanging on the wall.
}
expects.be:'equal? @[
express expected
express recite 10 10
expected
recite 10 10
]
]
]

View File

@@ -0,0 +1,4 @@
# unitt.toml - Configuration for unitt
path = "tests"
suffix = ".art"

View File

@@ -1,3 +1,7 @@
import.version:2.0.1 {unitt}!
exe: switch "windows" = sys\os
-> "unitt.bat"
-> "unitt"
runTests.failFast findTests "tests"
fullpath: normalize ~"|path\home|/.arturo/packages/bin/|exe|"
code: execute.code.directly ~"|fullpath|"
panic.unstyled.code: code ""

View File

@@ -1,4 +1,4 @@
import.version:2.0.1 {unitt}!
import.version:3.0.0 {unitt}!
import {src/change}!
describe "Change" [

View File

@@ -0,0 +1,4 @@
# unitt.toml - Configuration for unitt
path = "tests"
suffix = ".art"

View File

@@ -1,3 +1,7 @@
import.version:2.0.1 {unitt}!
exe: switch "windows" = sys\os
-> "unitt.bat"
-> "unitt"
runTests.failFast findTests "tests"
fullpath: normalize ~"|path\home|/.arturo/packages/bin/|exe|"
code: execute.code.directly ~"|fullpath|"
panic.unstyled.code: code ""

View File

@@ -1,145 +1,145 @@
import.version:2.0.1 {unitt}!
import.version:3.0.0 {unitt}!
import {src/clock}!
describe "Clock" [
describe "Clock - Create a new clock with an initial time" [
it "on the hour" [
expects.be:'equal? @[
express "08:00"
express to :string to :clock [8`hr 0`min]
"08:00"
to :string to :clock [8`hr 0`min]
]
]
it.skip "past the hour" [
expects.be:'equal? @[
express "11:09"
express to :string to :clock [11`hr 9`min]
"11:09"
to :string to :clock [11`hr 9`min]
]
]
it.skip "midnight is zero hours" [
expects.be:'equal? @[
express "00:00"
express to :string to :clock [24`hr 0`min]
"00:00"
to :string to :clock [24`hr 0`min]
]
]
it.skip "hour rolls over" [
expects.be:'equal? @[
express "01:00"
express to :string to :clock [25`hr 0`min]
"01:00"
to :string to :clock [25`hr 0`min]
]
]
it.skip "hour rolls over continuously" [
expects.be:'equal? @[
express "04:00"
express to :string to :clock [100`hr 0`min]
"04:00"
to :string to :clock [100`hr 0`min]
]
]
it.skip "sixty minutes is next hour" [
expects.be:'equal? @[
express "02:00"
express to :string to :clock [1`hr 60`min]
"02:00"
to :string to :clock [1`hr 60`min]
]
]
it.skip "minutes roll over" [
expects.be:'equal? @[
express "02:40"
express to :string to :clock [0`hr 160`min]
"02:40"
to :string to :clock [0`hr 160`min]
]
]
it.skip "minutes roll over continuously" [
expects.be:'equal? @[
express "04:43"
express to :string to :clock [0`hr 1723`min]
"04:43"
to :string to :clock [0`hr 1723`min]
]
]
it.skip "hour and minutes roll over" [
expects.be:'equal? @[
express "03:40"
express to :string to :clock [25`hr 160`min]
"03:40"
to :string to :clock [25`hr 160`min]
]
]
it.skip "hour and minutes roll over continuously" [
expects.be:'equal? @[
express "11:01"
express to :string to :clock [201`hr 3001`min]
"11:01"
to :string to :clock [201`hr 3001`min]
]
]
it.skip "hour and minutes roll over to exactly midnight" [
expects.be:'equal? @[
express "00:00"
express to :string to :clock [72`hr 8640`min]
"00:00"
to :string to :clock [72`hr 8640`min]
]
]
it.skip "negative hour" [
expects.be:'equal? @[
express "23:15"
express to :string to :clock @[neg 1`hr 15`min]
"23:15"
to :string to :clock @[neg 1`hr 15`min]
]
]
it.skip "negative hour rolls over" [
expects.be:'equal? @[
express "23:00"
express to :string to :clock @[neg 25`hr 0`min]
"23:00"
to :string to :clock @[neg 25`hr 0`min]
]
]
it.skip "negative hour rolls over continuously" [
expects.be:'equal? @[
express "05:00"
express to :string to :clock @[neg 91`hr 0`min]
"05:00"
to :string to :clock @[neg 91`hr 0`min]
]
]
it.skip "negative minutes" [
expects.be:'equal? @[
express "00:20"
express to :string to :clock @[1`hr neg 40`min]
"00:20"
to :string to :clock @[1`hr neg 40`min]
]
]
it.skip "negative minutes roll over" [
expects.be:'equal? @[
express "22:20"
express to :string to :clock @[1`hr neg 160`min]
"22:20"
to :string to :clock @[1`hr neg 160`min]
]
]
it.skip "negative minutes roll over continuously" [
expects.be:'equal? @[
express "16:40"
express to :string to :clock @[1`hr neg 4820`min]
"16:40"
to :string to :clock @[1`hr neg 4820`min]
]
]
it.skip "negative sixty minutes is previous hour" [
expects.be:'equal? @[
express "01:00"
express to :string to :clock @[2`hr neg 60`min]
"01:00"
to :string to :clock @[2`hr neg 60`min]
]
]
it.skip "negative hour and minutes roll over" [
expects.be:'equal? @[
express "20:20"
express to :string to :clock @[neg 25`hr neg 160`min]
"20:20"
to :string to :clock @[neg 25`hr neg 160`min]
]
]
it.skip "negative hour and minutes roll over continuously" [
expects.be:'equal? @[
express "22:10"
express to :string to :clock @[neg 121`hr neg 5810`min]
"22:10"
to :string to :clock @[neg 121`hr neg 5810`min]
]
]
]
@@ -149,8 +149,8 @@ describe "Clock" [
c: to :clock [10`hr 0`min]
do [c\increment 3`min]
expects.be:'equal? @[
express "10:03"
express to :string c
"10:03"
to :string c
]
]
@@ -158,8 +158,8 @@ describe "Clock" [
c: to :clock [6`hr 41`min]
do [c\increment 0`min]
expects.be:'equal? @[
express "06:41"
express to :string c
"06:41"
to :string c
]
]
@@ -167,8 +167,8 @@ describe "Clock" [
c: to :clock [0`hr 45`min]
do [c\increment 40`min]
expects.be:'equal? @[
express "01:25"
express to :string c
"01:25"
to :string c
]
]
@@ -176,8 +176,8 @@ describe "Clock" [
c: to :clock [10`hr 0`min]
do [c\increment 61`min]
expects.be:'equal? @[
express "11:01"
express to :string c
"11:01"
to :string c
]
]
@@ -185,8 +185,8 @@ describe "Clock" [
c: to :clock [0`hr 45`min]
do [c\increment 160`min]
expects.be:'equal? @[
express "03:25"
express to :string c
"03:25"
to :string c
]
]
@@ -194,8 +194,8 @@ describe "Clock" [
c: to :clock [23`hr 59`min]
do [c\increment 2`min]
expects.be:'equal? @[
express "00:01"
express to :string c
"00:01"
to :string c
]
]
@@ -203,8 +203,8 @@ describe "Clock" [
c: to :clock [5`hr 32`min]
do [c\increment 1500`min]
expects.be:'equal? @[
express "06:32"
express to :string c
"06:32"
to :string c
]
]
@@ -212,8 +212,8 @@ describe "Clock" [
c: to :clock [1`hr 1`min]
do [c\increment 3500`min]
expects.be:'equal? @[
express "11:21"
express to :string c
"11:21"
to :string c
]
]
]
@@ -224,8 +224,8 @@ describe "Clock" [
c: to :clock [10`hr 3`min]
do [c\decrement 3`min]
expects.be:'equal? @[
express "10:00"
express to :string c
"10:00"
to :string c
]
]
@@ -233,8 +233,8 @@ describe "Clock" [
c: to :clock [10`hr 3`min]
do [c\decrement 30`min]
expects.be:'equal? @[
express "09:33"
express to :string c
"09:33"
to :string c
]
]
@@ -242,8 +242,8 @@ describe "Clock" [
c: to :clock [10`hr 3`min]
do [c\decrement 70`min]
expects.be:'equal? @[
express "08:53"
express to :string c
"08:53"
to :string c
]
]
@@ -251,8 +251,8 @@ describe "Clock" [
c: to :clock [0`hr 3`min]
do [c\decrement 4`min]
expects.be:'equal? @[
express "23:59"
express to :string c
"23:59"
to :string c
]
]
@@ -260,8 +260,8 @@ describe "Clock" [
c: to :clock [0`hr 0`min]
do [c\decrement 160`min]
expects.be:'equal? @[
express "21:20"
express to :string c
"21:20"
to :string c
]
]
@@ -269,8 +269,8 @@ describe "Clock" [
c: to :clock [6`hr 15`min]
do [c\decrement 160`min]
expects.be:'equal? @[
express "03:35"
express to :string c
"03:35"
to :string c
]
]
@@ -278,8 +278,8 @@ describe "Clock" [
c: to :clock [5`hr 32`min]
do [c\decrement 1500`min]
expects.be:'equal? @[
express "04:32"
express to :string c
"04:32"
to :string c
]
]
@@ -287,8 +287,8 @@ describe "Clock" [
c: to :clock [2`hr 20`min]
do [c\decrement 3000`min]
expects.be:'equal? @[
express "00:20"
express to :string c
"00:20"
to :string c
]
]
]
@@ -296,57 +296,57 @@ describe "Clock" [
describe "Clock - Compare two clocks for equality" [
it "clocks with same time" [
expects.be:'equal? @[
express to :string to :clock [15`hr 37`min]
express to :string to :clock [15`hr 37`min]
to :string to :clock [15`hr 37`min]
to :string to :clock [15`hr 37`min]
]
]
it.skip "clocks a minute apart" [
expects.be:'notEqual? @[
express to :string to :clock [15`hr 36`min]
express to :string to :clock [15`hr 37`min]
to :string to :clock [15`hr 36`min]
to :string to :clock [15`hr 37`min]
]
]
it.skip "clocks an hour apart" [
expects.be:'notEqual? @[
express to :string to :clock [14`hr 37`min]
express to :string to :clock [15`hr 37`min]
to :string to :clock [14`hr 37`min]
to :string to :clock [15`hr 37`min]
]
]
it.skip "clocks with hour overflow" [
expects.be:'equal? @[
express to :string to :clock [10`hr 37`min]
express to :string to :clock [34`hr 37`min]
to :string to :clock [10`hr 37`min]
to :string to :clock [34`hr 37`min]
]
]
it.skip "clocks with hour overflow by several days" [
expects.be:'equal? @[
express to :string to :clock [3`hr 11`min]
express to :string to :clock [99`hr 11`min]
to :string to :clock [3`hr 11`min]
to :string to :clock [99`hr 11`min]
]
]
it.skip "clocks with negative hour" [
expects.be:'equal? @[
express to :string to :clock [22`hr 40`min]
express to :string to :clock @[neg 2`hr 40`min]
to :string to :clock [22`hr 40`min]
to :string to :clock @[neg 2`hr 40`min]
]
]
it.skip "clocks with negative hour that wraps" [
expects.be:'equal? @[
express to :string to :clock [17`hr 3`min]
express to :string to :clock @[neg 31`hr 3`min]
to :string to :clock [17`hr 3`min]
to :string to :clock @[neg 31`hr 3`min]
]
]
it.skip "clocks with negative hour that wraps multiple times" [
expects.be:'equal? @[
express to :string to :clock [13`hr 49`min]
express to :string to :clock @[neg 83`hr 49`min]
to :string to :clock [13`hr 49`min]
to :string to :clock @[neg 83`hr 49`min]
]
]
@@ -354,58 +354,58 @@ describe "Clock" [
c1: to :clock [0`hr 1`min]
c2: to :clock [0`hr 1441`min]
expects.be:'equal? @[
express to :string to :clock [0`hr 1`min]
express to :string to :clock [0`hr 1441`min]
to :string to :clock [0`hr 1`min]
to :string to :clock [0`hr 1441`min]
]
]
it.skip "clocks with minute overflow by several days" [
expects.be:'equal? @[
express to :string to :clock [2`hr 2`min]
express to :string to :clock [2`hr 4322`min]
to :string to :clock [2`hr 2`min]
to :string to :clock [2`hr 4322`min]
]
]
it.skip "clocks with negative minute" [
expects.be:'equal? @[
express to :string to :clock [2`hr 40`min]
express to :string to :clock @[3`hr neg 20`min]
to :string to :clock [2`hr 40`min]
to :string to :clock @[3`hr neg 20`min]
]
]
it.skip "clocks with negative minute that wraps" [
expects.be:'equal? @[
express to :string to :clock [4`hr 10`min]
express to :string to :clock @[5`hr neg 1490`min]
to :string to :clock [4`hr 10`min]
to :string to :clock @[5`hr neg 1490`min]
]
]
it.skip "clocks with negative minute that wraps multiple times" [
expects.be:'equal? @[
express to :string to :clock [6`hr 15`min]
express to :string to :clock @[6`hr neg 4305`min]
to :string to :clock [6`hr 15`min]
to :string to :clock @[6`hr neg 4305`min]
]
]
it.skip "clocks with negative hours and minutes" [
expects.be:'equal? @[
express to :string to :clock [7`hr 32`min]
express to :string to :clock @[neg 12`hr neg 268`min]
to :string to :clock [7`hr 32`min]
to :string to :clock @[neg 12`hr neg 268`min]
]
]
it.skip "clocks with negative hours and minutes that wrap" [
expects.be:'equal? @[
express to :string to :clock [18`hr 7`min]
express to :string to :clock @[neg 54`hr neg 11513`min]
to :string to :clock [18`hr 7`min]
to :string to :clock @[neg 54`hr neg 11513`min]
]
]
it.skip "full clock and zeroed clock" [
expects.be:'equal? @[
express to :string to :clock [24`hr 0`min]
express to :string to :clock [0`hr 0`min]
to :string to :clock [24`hr 0`min]
to :string to :clock [0`hr 0`min]
]
]
]

View File

@@ -0,0 +1,4 @@
# unitt.toml - Configuration for unitt
path = "tests"
suffix = ".art"

View File

@@ -1,3 +1,7 @@
import.version:2.0.1 {unitt}!
exe: switch "windows" = sys\os
-> "unitt.bat"
-> "unitt"
runTests.failFast findTests "tests"
fullpath: normalize ~"|path\home|/.arturo/packages/bin/|exe|"
code: execute.code.directly ~"|fullpath|"
panic.unstyled.code: code ""

View File

@@ -1,4 +1,4 @@
import.version:2.0.1 {unitt}!
import.version:3.0.0 {unitt}!
import {src/collatz-conjecture}!
describe "Collatz Conjecture"[

View File

@@ -0,0 +1,4 @@
# unitt.toml - Configuration for unitt
path = "tests"
suffix = ".art"

View File

@@ -1,3 +1,7 @@
import.version:2.0.1 {unitt}!
exe: switch "windows" = sys\os
-> "unitt.bat"
-> "unitt"
runTests.failFast findTests "tests"
fullpath: normalize ~"|path\home|/.arturo/packages/bin/|exe|"
code: execute.code.directly ~"|fullpath|"
panic.unstyled.code: code ""

View File

@@ -1,4 +1,4 @@
import.version:2.0.1 {unitt}!
import.version:3.0.0 {unitt}!
import {src/darts}!
describe "Darts" [

View File

@@ -0,0 +1,4 @@
# unitt.toml - Configuration for unitt
path = "tests"
suffix = ".art"

View File

@@ -1,3 +1,7 @@
import.version:2.0.1 {unitt}!
exe: switch "windows" = sys\os
-> "unitt.bat"
-> "unitt"
runTests.failFast findTests "tests"
fullpath: normalize ~"|path\home|/.arturo/packages/bin/|exe|"
code: execute.code.directly ~"|fullpath|"
panic.unstyled.code: code ""

View File

@@ -1,11 +1,11 @@
import.version:2.0.1 {unitt}!
import.version:3.0.0 {unitt}!
import {src/diamond}!
describe "Diamond" [
it "Degenerate case with a single 'A' row" [
expects.be:'equal? @[
express "A"
express diamond 'A'
"A"
diamond 'A'
]
]
@@ -16,8 +16,8 @@ describe "Diamond" [
" A "
]
expects.be:'equal? @[
express expected
express diamond 'B'
expected
diamond 'B'
]
]
@@ -30,8 +30,8 @@ describe "Diamond" [
" A "
]
expects.be:'equal? @[
express expected
express diamond 'C'
expected
diamond 'C'
]
]
@@ -46,8 +46,8 @@ describe "Diamond" [
" A "
]
expects.be:'equal? @[
express expected
express diamond 'D'
expected
diamond 'D'
]
]
@@ -106,8 +106,8 @@ describe "Diamond" [
" A "
]
expects.be:'equal? @[
express expected
express diamond 'Z'
expected
diamond 'Z'
]
]
]

View File

@@ -0,0 +1,4 @@
# unitt.toml - Configuration for unitt
path = "tests"
suffix = ".art"

View File

@@ -1,3 +1,7 @@
import.version:2.0.1 {unitt}!
exe: switch "windows" = sys\os
-> "unitt.bat"
-> "unitt"
runTests.failFast findTests "tests"
fullpath: normalize ~"|path\home|/.arturo/packages/bin/|exe|"
code: execute.code.directly ~"|fullpath|"
panic.unstyled.code: code ""

View File

@@ -1,4 +1,4 @@
import.version:2.0.1 {unitt}!
import.version:3.0.0 {unitt}!
import {src/difference-of-squares}!
describe "Difference of Squares"[

View File

@@ -0,0 +1,4 @@
# unitt.toml - Configuration for unitt
path = "tests"
suffix = ".art"

View File

@@ -1,3 +1,7 @@
import.version:2.0.1 {unitt}!
exe: switch "windows" = sys\os
-> "unitt.bat"
-> "unitt"
runTests.failFast findTests "tests"
fullpath: normalize ~"|path\home|/.arturo/packages/bin/|exe|"
code: execute.code.directly ~"|fullpath|"
panic.unstyled.code: code ""

View File

@@ -1,4 +1,4 @@
import.version:2.0.1 {unitt}!
import.version:3.0.0 {unitt}!
import {src/dnd-character}!
describe "D&D Character" [

View File

@@ -0,0 +1,4 @@
# unitt.toml - Configuration for unitt
path = "tests"
suffix = ".art"

View File

@@ -1,3 +1,7 @@
import.version:2.0.1 {unitt}!
exe: switch "windows" = sys\os
-> "unitt.bat"
-> "unitt"
runTests.failFast findTests "tests"
fullpath: normalize ~"|path\home|/.arturo/packages/bin/|exe|"
code: execute.code.directly ~"|fullpath|"
panic.unstyled.code: code ""

View File

@@ -1,4 +1,4 @@
import.version:2.0.1 {unitt}!
import.version:3.0.0 {unitt}!
import {src/eliuds-eggs}!
describe "Eliud's Eggs" [

View File

@@ -0,0 +1,4 @@
# unitt.toml - Configuration for unitt
path = "tests"
suffix = ".art"

View File

@@ -1,3 +1,7 @@
import.version:2.0.1 {unitt}!
exe: switch "windows" = sys\os
-> "unitt.bat"
-> "unitt"
runTests.failFast findTests "tests"
fullpath: normalize ~"|path\home|/.arturo/packages/bin/|exe|"
code: execute.code.directly ~"|fullpath|"
panic.unstyled.code: code ""

View File

@@ -1,4 +1,4 @@
import.version:2.0.1 {unitt}!
import.version:3.0.0 {unitt}!
import {src/etl}!
describe "ETL" [

View File

@@ -0,0 +1,4 @@
# unitt.toml - Configuration for unitt
path = "tests"
suffix = ".art"

View File

@@ -1,3 +1,7 @@
import.version:2.0.1 {unitt}!
exe: switch "windows" = sys\os
-> "unitt.bat"
-> "unitt"
runTests.failFast findTests "tests"
fullpath: normalize ~"|path\home|/.arturo/packages/bin/|exe|"
code: execute.code.directly ~"|fullpath|"
panic.unstyled.code: code ""

View File

@@ -1,4 +1,4 @@
import.version:2.0.1 {unitt}!
import.version:3.0.0 {unitt}!
import {src/flatten-array}!
describe "Flatten Array" [

View File

@@ -0,0 +1,4 @@
# unitt.toml - Configuration for unitt
path = "tests"
suffix = ".art"

View File

@@ -1,3 +1,7 @@
import.version:2.0.1 {unitt}!
exe: switch "windows" = sys\os
-> "unitt.bat"
-> "unitt"
runTests.failFast findTests "tests"
fullpath: normalize ~"|path\home|/.arturo/packages/bin/|exe|"
code: execute.code.directly ~"|fullpath|"
panic.unstyled.code: code ""

View File

@@ -1,18 +1,18 @@
import.version:2.0.1 {unitt}!
import.version:3.0.0 {unitt}!
import {src/flower-field}!
describe "Flower Field"[
it "no rows" [
expects.be:'equal? @[
express []
express annotate []
[]
annotate []
]
]
it.skip "no columns" [
expects.be:'equal? @[
express [""]
express annotate [""]
[""]
annotate [""]
]
]
@@ -28,8 +28,8 @@ describe "Flower Field"[
" "
]
expects.be:'equal? @[
express expected
express annotate garden
expected
annotate garden
]
]
@@ -45,8 +45,8 @@ describe "Flower Field"[
"***"
]
expects.be:'equal? @[
express expected
express annotate garden
expected
annotate garden
]
]
@@ -62,8 +62,8 @@ describe "Flower Field"[
"111"
]
expects.be:'equal? @[
express expected
express annotate garden
expected
annotate garden
]
]
@@ -79,8 +79,8 @@ describe "Flower Field"[
"***"
]
expects.be:'equal? @[
express expected
express annotate garden
expected
annotate garden
]
]
@@ -88,8 +88,8 @@ describe "Flower Field"[
garden: [" * * "]
expected: ["1*2*1"]
expects.be:'equal? @[
express expected
express annotate garden
expected
annotate garden
]
]
@@ -97,8 +97,8 @@ describe "Flower Field"[
garden: ["* *"]
expected: ["*1 1*"]
expects.be:'equal? @[
express expected
express annotate garden
expected
annotate garden
]
]
@@ -118,8 +118,8 @@ describe "Flower Field"[
"1"
]
expects.be:'equal? @[
express expected
express annotate garden
expected
annotate garden
]
]
@@ -139,8 +139,8 @@ describe "Flower Field"[
"*"
]
expects.be:'equal? @[
express expected
express annotate garden
expected
annotate garden
]
]
@@ -160,8 +160,8 @@ describe "Flower Field"[
" 2*2 "
]
expects.be:'equal? @[
express expected
express annotate garden
expected
annotate garden
]
]
@@ -183,8 +183,8 @@ describe "Flower Field"[
"111111"
]
expects.be:'equal? @[
express expected
express annotate garden
expected
annotate garden
]
]
]

View File

@@ -0,0 +1,4 @@
# unitt.toml - Configuration for unitt
path = "tests"
suffix = ".art"

View File

@@ -1,3 +1,7 @@
import.version:2.0.1 {unitt}!
exe: switch "windows" = sys\os
-> "unitt.bat"
-> "unitt"
runTests.failFast findTests "tests"
fullpath: normalize ~"|path\home|/.arturo/packages/bin/|exe|"
code: execute.code.directly ~"|fullpath|"
panic.unstyled.code: code ""

View File

@@ -1,46 +1,46 @@
import.version:2.0.1 {unitt}!
import.version:3.0.0 {unitt}!
import {src/food-chain}!
describe "Food Chain" [
it "fly" [
expects.be:'equal? @[
express {
{
I know an old lady who swallowed a fly.
I don't know why she swallowed the fly. Perhaps she'll die.
}
express recite 1 1
recite 1 1
]
]
it.skip "spider" [
expects.be:'equal? @[
express {
{
I know an old lady who swallowed a spider.
It wriggled and jiggled and tickled inside her.
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly. Perhaps she'll die.
}
express recite 2 2
recite 2 2
]
]
it.skip "bird" [
expects.be:'equal? @[
express {
{
I know an old lady who swallowed a bird.
How absurd to swallow a bird!
She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly. Perhaps she'll die.
}
express recite 3 3
recite 3 3
]
]
it.skip "cat" [
expects.be:'equal? @[
express {
{
I know an old lady who swallowed a cat.
Imagine that, to swallow a cat!
She swallowed the cat to catch the bird.
@@ -48,13 +48,13 @@ describe "Food Chain" [
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly. Perhaps she'll die.
}
express recite 4 4
recite 4 4
]
]
it.skip "dog" [
expects.be:'equal? @[
express {
{
I know an old lady who swallowed a dog.
What a hog, to swallow a dog!
She swallowed the dog to catch the cat.
@@ -63,13 +63,13 @@ describe "Food Chain" [
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly. Perhaps she'll die.
}
express recite 5 5
recite 5 5
]
]
it.skip "goat" [
expects.be:'equal? @[
express {
{
I know an old lady who swallowed a goat.
Just opened her throat and swallowed a goat!
She swallowed the goat to catch the dog.
@@ -79,13 +79,13 @@ describe "Food Chain" [
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly. Perhaps she'll die.
}
express recite 6 6
recite 6 6
]
]
it.skip "cow" [
expects.be:'equal? @[
express {
{
I know an old lady who swallowed a cow.
I don't know how she swallowed a cow!
She swallowed the cow to catch the goat.
@@ -96,23 +96,23 @@ describe "Food Chain" [
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly. Perhaps she'll die.
}
express recite 7 7
recite 7 7
]
]
it.skip "horse" [
expects.be:'equal? @[
express {
{
I know an old lady who swallowed a horse.
She's dead, of course!
}
express recite 8 8
recite 8 8
]
]
it.skip "multiple verses" [
expects.be:'equal? @[
express {
{
I know an old lady who swallowed a fly.
I don't know why she swallowed the fly. Perhaps she'll die.
@@ -127,13 +127,13 @@ describe "Food Chain" [
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly. Perhaps she'll die.
}
express recite 1 3
recite 1 3
]
]
it.skip "full song" [
expects.be:'equal? @[
express {
{
I know an old lady who swallowed a fly.
I don't know why she swallowed the fly. Perhaps she'll die.
@@ -185,7 +185,7 @@ describe "Food Chain" [
I know an old lady who swallowed a horse.
She's dead, of course!
}
express recite 1 8
recite 1 8
]
]
]

View File

@@ -0,0 +1,4 @@
# unitt.toml - Configuration for unitt
path = "tests"
suffix = ".art"

View File

@@ -1,3 +1,7 @@
import.version:2.0.1 {unitt}!
exe: switch "windows" = sys\os
-> "unitt.bat"
-> "unitt"
runTests.failFast findTests "tests"
fullpath: normalize ~"|path\home|/.arturo/packages/bin/|exe|"
code: execute.code.directly ~"|fullpath|"
panic.unstyled.code: code ""

View File

@@ -1,4 +1,4 @@
import.version:2.0.1 {unitt}!
import.version:3.0.0 {unitt}!
import {src/game-of-life}!
describe "Conway's Game of Life" [

View File

@@ -0,0 +1,4 @@
# unitt.toml - Configuration for unitt
path = "tests"
suffix = ".art"

View File

@@ -1,3 +1,7 @@
import.version:2.0.1 {unitt}!
exe: switch "windows" = sys\os
-> "unitt.bat"
-> "unitt"
runTests.failFast findTests "tests"
fullpath: normalize ~"|path\home|/.arturo/packages/bin/|exe|"
code: execute.code.directly ~"|fullpath|"
panic.unstyled.code: code ""

View File

@@ -1,39 +1,39 @@
import.version:2.0.1 {unitt}!
import.version:3.0.0 {unitt}!
import {src/gigasecond}!
describe "Gigasecond" [
it "date only specification of time" [
expects.be:'equal? @[
express to :date.format: "yyyy-MM-dd hh:mm:sszz" "2043-01-01 01:46:40+00"
express gigasecond to :date.format: "yyyy-MM-ddzz" "2011-04-25+00"
to :date.format: "yyyy-MM-dd hh:mm:sszz" "2043-01-01 01:46:40+00"
gigasecond to :date.format: "yyyy-MM-ddzz" "2011-04-25+00"
]
]
it.skip "second test for date only specification of time" [
expects.be:'equal? @[
express to :date.format: "yyyy-MM-dd hh:mm:sszz" "2009-02-19 01:46:40+00"
express gigasecond to :date.format: "yyyy-MM-ddzz" "1977-06-13+00"
to :date.format: "yyyy-MM-dd hh:mm:sszz" "2009-02-19 01:46:40+00"
gigasecond to :date.format: "yyyy-MM-ddzz" "1977-06-13+00"
]
]
it.skip "third test for date only specification of time" [
expects.be:'equal? @[
express to :date.format: "yyyy-MM-dd hh:mm:sszz" "1991-03-27 01:46:40+00"
express gigasecond to :date.format: "yyyy-MM-ddzz" "1959-07-19+00"
to :date.format: "yyyy-MM-dd hh:mm:sszz" "1991-03-27 01:46:40+00"
gigasecond to :date.format: "yyyy-MM-ddzz" "1959-07-19+00"
]
]
it.skip "full time specified" [
expects.be:'equal? @[
express to :date.format: "yyyy-MM-dd hh:mm:sszz" "2046-10-02 23:46:40+00"
express gigasecond to :date.format: "yyyy-MM-dd hh:mm:sszz" "2015-01-24 22:00:00+00"
to :date.format: "yyyy-MM-dd hh:mm:sszz" "2046-10-02 23:46:40+00"
gigasecond to :date.format: "yyyy-MM-dd hh:mm:sszz" "2015-01-24 22:00:00+00"
]
]
it.skip "full time with day roll-over" [
expects.be:'equal? @[
express to :date.format: "yyyy-MM-dd hh:mm:sszz" "2046-10-03 01:46:39+00"
express gigasecond to :date.format: "yyyy-MM-dd hh:mm:sszz" "2015-01-24 23:59:59+00"
to :date.format: "yyyy-MM-dd hh:mm:sszz" "2046-10-03 01:46:39+00"
gigasecond to :date.format: "yyyy-MM-dd hh:mm:sszz" "2015-01-24 23:59:59+00"
]
]
]

View File

@@ -0,0 +1,4 @@
# unitt.toml - Configuration for unitt
path = "tests"
suffix = ".art"

View File

@@ -1,3 +1,7 @@
import.version:2.0.1 {unitt}!
exe: switch "windows" = sys\os
-> "unitt.bat"
-> "unitt"
runTests.failFast findTests "tests"
fullpath: normalize ~"|path\home|/.arturo/packages/bin/|exe|"
code: execute.code.directly ~"|fullpath|"
panic.unstyled.code: code ""

View File

@@ -1,4 +1,4 @@
import.version:2.0.1 {unitt}!
import.version:3.0.0 {unitt}!
import {src/grains}!
describe "Grains" [

View File

@@ -0,0 +1,4 @@
# unitt.toml - Configuration for unitt
path = "tests"
suffix = ".art"

View File

@@ -1,3 +1,7 @@
import.version:2.0.1 {unitt}!
exe: switch "windows" = sys\os
-> "unitt.bat"
-> "unitt"
runTests.failFast findTests "tests"
fullpath: normalize ~"|path\home|/.arturo/packages/bin/|exe|"
code: execute.code.directly ~"|fullpath|"
panic.unstyled.code: code ""

View File

@@ -1,4 +1,4 @@
import.version:2.0.1 {unitt}!
import.version:3.0.0 {unitt}!
import {src/hamming}!
describe "Hamming" [

View File

@@ -0,0 +1,4 @@
# unitt.toml - Configuration for unitt
path = "tests"
suffix = ".art"

View File

@@ -1,3 +1,7 @@
import.version:2.0.1 {unitt}!
exe: switch "windows" = sys\os
-> "unitt.bat"
-> "unitt"
runTests.failFast findTests "tests"
fullpath: normalize ~"|path\home|/.arturo/packages/bin/|exe|"
code: execute.code.directly ~"|fullpath|"
panic.unstyled.code: code ""

View File

@@ -1,4 +1,4 @@
import.version:2.0.1 {unitt}!
import.version:3.0.0 {unitt}!
import {src/hello-world}!
describe "Hello World!" [

View File

@@ -0,0 +1,4 @@
# unitt.toml - Configuration for unitt
path = "tests"
suffix = ".art"

View File

@@ -1,3 +1,7 @@
import.version:2.0.1 {unitt}!
exe: switch "windows" = sys\os
-> "unitt.bat"
-> "unitt"
runTests.failFast findTests "tests"
fullpath: normalize ~"|path\home|/.arturo/packages/bin/|exe|"
code: execute.code.directly ~"|fullpath|"
panic.unstyled.code: code ""

View File

@@ -1,4 +1,4 @@
import.version:2.0.1 {unitt}!
import.version:3.0.0 {unitt}!
import {src/high-scores}!
describe "High Scores" [

View File

@@ -0,0 +1,4 @@
# unitt.toml - Configuration for unitt
path = "tests"
suffix = ".art"

View File

@@ -1,3 +1,7 @@
import.version:2.0.1 {unitt}!
exe: switch "windows" = sys\os
-> "unitt.bat"
-> "unitt"
runTests.failFast findTests "tests"
fullpath: normalize ~"|path\home|/.arturo/packages/bin/|exe|"
code: execute.code.directly ~"|fullpath|"
panic.unstyled.code: code ""

View File

@@ -1,20 +1,20 @@
import.version:2.0.1 {unitt}!
import.version:3.0.0 {unitt}!
import {src/house}!
describe "House" [
it "verse one - the house that Jack built" [
expects.be:'equal? @[
express "This is the house that Jack built."
express recite 1 1
"This is the house that Jack built."
recite 1 1
]
]
it.skip "verse two - the malt that lay" [
expects.be:'equal? @[
express "This is the malt that lay in the house that Jack built."
express recite 2 2
"This is the malt that lay in the house that Jack built."
recite 2 2
]
]
@@ -26,8 +26,8 @@ describe "House" [
"the house that Jack built."
]
expects.be:'equal? @[
express expected
express recite 3 3
expected
recite 3 3
]
]
@@ -40,8 +40,8 @@ describe "House" [
"the house that Jack built."
]
expects.be:'equal? @[
express expected
express recite 4 4
expected
recite 4 4
]
]
@@ -55,8 +55,8 @@ describe "House" [
"the house that Jack built."
]
expects.be:'equal? @[
express expected
express recite 5 5
expected
recite 5 5
]
]
@@ -71,8 +71,8 @@ describe "House" [
"the house that Jack built."
]
expects.be:'equal? @[
express expected
express recite 6 6
expected
recite 6 6
]
]
@@ -88,8 +88,8 @@ describe "House" [
"the house that Jack built."
]
expects.be:'equal? @[
express expected
express recite 7 7
expected
recite 7 7
]
]
@@ -106,8 +106,8 @@ describe "House" [
"the house that Jack built."
]
expects.be:'equal? @[
express expected
express recite 8 8
expected
recite 8 8
]
]
@@ -125,8 +125,8 @@ describe "House" [
"the house that Jack built."
]
expects.be:'equal? @[
express expected
express recite 9 9
expected
recite 9 9
]
]
@@ -145,8 +145,8 @@ describe "House" [
"the house that Jack built."
]
expects.be:'equal? @[
express expected
express recite 10 10
expected
recite 10 10
]
]
@@ -166,8 +166,8 @@ describe "House" [
"the house that Jack built."
]
expects.be:'equal? @[
express expected
express recite 11 11
expected
recite 11 11
]
]
@@ -188,8 +188,8 @@ describe "House" [
"the house that Jack built."
]
expects.be:'equal? @[
express expected
express recite 12 12
expected
recite 12 12
]
]
@@ -242,8 +242,8 @@ describe "House" [
]
]
expects.be:'equal? @[
express expected
express recite 4 8
expected
recite 4 8
]
]
@@ -363,8 +363,8 @@ describe "House" [
]
expects.be:'equal? @[
express expected
express recite 1 12
expected
recite 1 12
]
]
]

View File

@@ -0,0 +1,4 @@
# unitt.toml - Configuration for unitt
path = "tests"
suffix = ".art"

View File

@@ -1,3 +1,7 @@
import.version:2.0.1 {unitt}!
exe: switch "windows" = sys\os
-> "unitt.bat"
-> "unitt"
runTests.failFast findTests "tests"
fullpath: normalize ~"|path\home|/.arturo/packages/bin/|exe|"
code: execute.code.directly ~"|fullpath|"
panic.unstyled.code: code ""

View File

@@ -1,4 +1,4 @@
import.version:2.0.1 {unitt}!
import.version:3.0.0 {unitt}!
import {src/isbn-verifier}!
describe "ISBN Verifier" [

View File

@@ -0,0 +1,4 @@
# unitt.toml - Configuration for unitt
path = "tests"
suffix = ".art"

View File

@@ -1,3 +1,7 @@
import.version:2.0.1 {unitt}!
exe: switch "windows" = sys\os
-> "unitt.bat"
-> "unitt"
runTests.failFast findTests "tests"
fullpath: normalize ~"|path\home|/.arturo/packages/bin/|exe|"
code: execute.code.directly ~"|fullpath|"
panic.unstyled.code: code ""

View File

@@ -1,4 +1,4 @@
import.version:2.0.1 {unitt}!
import.version:3.0.0 {unitt}!
import {src/isogram}!
describe "Isogram" [

View File

@@ -0,0 +1,4 @@
# unitt.toml - Configuration for unitt
path = "tests"
suffix = ".art"

View File

@@ -1,3 +1,7 @@
import.version:2.0.1 {unitt}!
exe: switch "windows" = sys\os
-> "unitt.bat"
-> "unitt"
runTests.failFast findTests "tests"
fullpath: normalize ~"|path\home|/.arturo/packages/bin/|exe|"
code: execute.code.directly ~"|fullpath|"
panic.unstyled.code: code ""

View File

@@ -1,4 +1,4 @@
import.version:2.0.1 {unitt}!
import.version:3.0.0 {unitt}!
import {src/kindergarten-garden}!
describe "Kindergarten Garden" [

View File

@@ -0,0 +1,4 @@
# unitt.toml - Configuration for unitt
path = "tests"
suffix = ".art"

View File

@@ -1,3 +1,7 @@
import.version:2.0.1 {unitt}!
exe: switch "windows" = sys\os
-> "unitt.bat"
-> "unitt"
runTests.failFast findTests "tests"
fullpath: normalize ~"|path\home|/.arturo/packages/bin/|exe|"
code: execute.code.directly ~"|fullpath|"
panic.unstyled.code: code ""

View File

@@ -1,4 +1,4 @@
import.version:2.0.1 {unitt}!
import.version:3.0.0 {unitt}!
import {src/largest-series-product}!
describe "Largest Series Product" [

View File

@@ -0,0 +1,4 @@
# unitt.toml - Configuration for unitt
path = "tests"
suffix = ".art"

View File

@@ -1,3 +1,7 @@
import.version:2.0.1 {unitt}!
exe: switch "windows" = sys\os
-> "unitt.bat"
-> "unitt"
runTests.failFast findTests "tests"
fullpath: normalize ~"|path\home|/.arturo/packages/bin/|exe|"
code: execute.code.directly ~"|fullpath|"
panic.unstyled.code: code ""

View File

@@ -1,4 +1,4 @@
import.version:2.0.1 {unitt}!
import.version:3.0.0 {unitt}!
import {src/leap}!
describe "Leap" [

Some files were not shown because too many files have changed in this diff Show More