1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-20 01:57:09 +03:00
Commit Graph

140 Commits

Author SHA1 Message Date
Dov Murik
55c2524201 tests: Add test cases in step4 and step9 2017-07-20 11:36:36 +00:00
Joel Martin
a112da51b4 Merge pull request #260 from def-/master
Update to Nim 0.17.0
2017-05-23 13:48:51 -05:00
Dennis Felsing
4603f2a931 Update to Nim 0.17.0 2017-05-23 19:07:34 +02:00
Joel Martin
681ce637b6 Deprecate tests/docker/Dockerfile 2017-05-23 11:04:32 -05:00
Joel Martin
b3658328e4 Merge branch 'master' of github.com:kanaka/mal 2016-10-31 17:41:58 -05:00
Joel Martin
37d75dc6dd Basic: pass required tests. Printer fix.
Also, move dissoc and hashmap equality tests to optional/soft since
they aren't actually needed for self-hosting.
2016-10-28 22:02:59 -05:00
Joel Martin
4e7d8a1bcf Basic: fix step6 arg test. Gensym. Misc cleanup.
- Strip linefeeds in run_argv_test.sh so that step6 arg test passes
  for basic.
- Add gensym and convert or macro.
- Add gitignore entries for transpiled basic sources.
- Add conj/seq stubs so that step4 self-host loads (if non-step4
  functions are commented out in core.mal)
- Bump up Z% value space by 256 spaces (1K)
- Remove old qb2cbm.sh
2016-10-28 00:09:56 -05:00
Vasilij Schneidermann
3c7b63d2e1 Ensure assoc updates maps properly 2016-10-24 22:50:15 +02:00
Joel Martin
70f29a2b3c Basic: step8 basics. Fix def!, let*, concat, scalars.
- Move apply logic in swap! to APPLY function in types and use that
  for macroexpand
- Abort def! if error before updating the environment
- let* wasn't properly saving A2% for the final eval. Also, the
  environment release check should be against the top-level EVAL env,
  not the root repl env.
- (concat (list) ...) was broken so fix it to ignore empty lists that
  aren't in the trailing position.
- nil, false and true in the reader were always being returned as
  references (with an ref cnt) but we have the assumption that
  references (14) are not ref cnt'd and are always part of a compound
  type so fix the reader to just return the interned addresses.
2016-10-06 22:22:57 -05:00
Joel Martin
9e8f521118 Basic: step7 basics, reader macros. step1,3 tests.
Also:
- Add some step1 and step3 tests that were discovered during Basic
  development.
- Move PR_MEMORY* to debug.in.bas
- Simplify Makefile deps
- Fix freeing in steps4-7 when error at deeper level
  i.e. (prn (abc))
- add SLICE function to support concat implementation.
2016-09-21 23:27:12 -05:00
Joel Martin
b7b1787f83 Basic: step2 basics. Vectors and hash-maps.
Adjust step2 tests to keep values within 2 byte int range.
2016-09-10 22:13:27 -05:00
Joel Martin
5e38bc9922 Fix step4 case sensitivity test. 2016-08-24 17:48:56 -05:00
Joel Martin
a7ed71b9e2 tests: additional tests based on PowerShell impl
- step1: empty list and vector
- step4: special forms case-sensitivity
- step9: apply with an empty list/vector
2016-08-24 17:39:24 -05:00
Dov Murik
eb63e565f3 tests: Verify case sensitivity of names and strings 2016-06-13 01:11:41 -04:00
Dov Murik
d3c401c1e8 tests: Test *ARGV* is set correctly in step 6
Add new mini test harness run_argv_test.sh to run the Mal interpreter
with different command-line arguments and test the stdout of that
process.

The main Makefile will automatically run the new harness whenever step 6
is tested (either directly or during REGRESS=1 of a more advanced step).
2016-05-11 11:31:04 -04:00
Joel Martin
c4dd3eb8c4 Merge pull request #210 from dubek/test-slurp-newline
tests: Test slurp captures final newline in step6
2016-05-10 12:41:44 -05:00
Dov Murik
2cd015e56a tests: Test slurp captures final newline in step6 2016-05-10 12:36:06 -04:00
Joel Martin
a1eb30fcc9 Use more common spelling of deferrable.
Deferable is apprently a less common but correct spelling.
2016-05-10 10:26:39 -05:00
Joel Martin
46e2568944 Makefile/runtest/tests: deferable/optional options
- tests/*: marked with deferable and optional runtest flags. Some
  moving around of tests within different sections to more closely
  align with the guide.
- runtest.py has --deferable/--no-deferable and
  --optional/--no-optional to control whether tests marked as
  deferable and optional are tested.
- Makefile: DEFERABLE and OPTIONAL top level flags to be passed to
  runtest when running tests.
- Also, fix problems in java quoting revealed by step7 test changes.
2016-05-09 21:14:15 -05:00
Joel Martin
c3a87f5174 tests: make throw of non-strings optional/soft. 2016-05-02 23:37:15 -05:00
Joel Martin
a26c2568b9 tests: move empty list test from step3 to step2. 2016-04-02 17:50:07 -05:00
Dov Murik
2318398419 tests: Add test for literal empty list in step3 2016-03-27 22:16:55 -04:00
Joel Martin
dca6b58578 Tests: move step5 non-TCO tests to per impl.
- Remove most of the step5 excludes in the Makefile except for ones
  which don't have TCO capability at all (or the implementation is too
  slow): bash, make, mal, matlab.

- Make perf_EXCLUDES consistent with other excludes.

- Add a print-FOO target which prints the resolved value of Makefile
  variable FOO. For example, `make print-IMPLS` to print the list of
  implementations.
2016-03-14 23:39:21 -05:00
Joel Martin
0067158f6d Object Pascal: full implementation. Test cleanup.
- Move vector related step4 and step6 tests to optional.
- Fix two step9 tests that weren't checking return value.
2016-03-13 17:12:01 -05:00
Joel Martin
077cdf6ff2 Merge pull request #184 from dubek/mal-time-ms
mal: Add time-ms to core; add tests for time-ms
2016-03-09 14:18:07 -06:00
Dov Murik
05ad2bf6cd ruby: concat should not modify its argument 2016-03-09 14:23:13 -05:00
Dov Murik
44c9a7d8be mal: Add time-ms to core; add tests for time-ms 2016-03-09 13:09:11 -05:00
Joel Martin
de3f3ed1ff tests/step3: test def! within let*. Fix groovy build. 2016-03-07 22:25:30 -06:00
Joel Martin
a61be4d37d bash: fix negative nums, more complex test.
Issue #178
2016-02-26 21:00:14 -06:00
Dov Murik
2c1eb1af68 ocaml: fix negative numbers handling 2016-02-25 17:39:32 -08:00
Joel Martin
8e32dbb6aa groovy, java, scala: add seq/string?.
Issue #166.

Also, add keyword? step9 test on zero length strings.
2016-02-12 09:59:39 -06:00
Joel Martin
329b6db3cf Add seq and string? tests.
Issue #166
2016-02-11 09:17:49 -06:00
Joel Martin
17946efbad Haxe, Julia, miniMAL: self-hosting fixes.
- Haxe: correctly set *ARGV*
- Julia: fix map function concatenation of results
- miniMAL: fix (= 'abc nil) and add test in step7 to catch it.
2016-02-05 13:27:30 -06:00
Dov Murik
4e284171ed tests: Add tests for (first nil) and (rest nil) 2016-02-03 21:23:45 -05:00
Joel Martin
35ea7a9ec7 Remove soft around nested equality tests
Related to issue #123
2016-02-01 15:10:12 -06:00
Dov Murik
163964afe1 tests: verify list/vector equality in hash-map values
This is still in the soft-tests section of tests/step9_try.mal.

Issues: #116, #123
2016-02-01 11:06:00 -05:00
Dov Murik
6205526a91 tests: Verify extra args (after &) are in a mal list
step4: before TCO
step9: after TCO and bypass TCO using `apply`
2016-01-29 21:37:30 -05:00
Dov Murik
a16bb08f51 python: Fix equality of unicode/normal strings in Python 2.x 2016-01-27 13:02:14 -05:00
Joel Martin
9bca0b57e3 tests: make macro result evaluation mandatory. 2016-01-26 14:21:05 -06:00
Dov Murik
718f8e4d6c tests/stepA: add gensym and clean or macro tests 2016-01-22 23:47:51 -05:00
Dov Murik
a193b2c470 tests/step8: remove and macro tests, add ->> macro tests
1. `gensym` isn't yet available in step8
2. `and` tests are very slow in some implementations
3. ->> macro is more complex
4. moved core.mal to the end so it won't override the builtin `or` macro
2016-01-22 23:47:50 -05:00
Joel Martin
6523be9f1a Add macro result eval test.
Test to cover bug https://github.com/kanaka/mal/issues/142
2016-01-20 15:28:55 -06:00
Dov Murik
627bd6f766 process, tests: move atoms implementation from stepA to step6 2016-01-06 14:33:55 +02:00
Dov Murik
3dcaa6ce43 js: Fix exception in `(nil) 2015-12-28 10:22:58 +02:00
Dov Murik
c4cd270022 tests: Add str and pr-str tests in step4 and step9
Specifically test serializing nil, empty collections and `str` of
collections.  The Mal implementation is *not* identical to Clojure for
these cases.
2015-12-17 22:01:31 +02:00
Dov Murik
539427f0db nim: fix tokenizer endless loop (and out-of-memory) on bad input
The input string `(prn "abc` caused the nim implementaion (from step1
onwards) to enter an endless loop in tokenize (which eventually caused
out-of-memory).

The fix verfies that indeed the regex matches a non-empty substring
before adding that substring as a token.
2015-12-04 15:35:39 -05:00
Joel Martin
c46b421a24 Haskell: fix simple vector equality. Add test.
- Was missing vector to vector equality but never noticed because test
  was missing.
- Related to #123
2015-12-03 16:27:47 -06:00
Dov Murik
6496cd1d17 tests: add tests for nil hashmap values 2015-12-02 15:52:32 -05:00
Joel Martin
5044ce44f4 Tests: add nested hash-map tests. 2015-12-02 11:16:09 -06:00
Dov Murik
4b7f92e5d6 tests: add soft tests for nested vector/list equality in step 4 2015-11-30 10:35:14 -05:00