Commit graph

51 commits

Author SHA1 Message Date
John Wiegley 431006f524
Merge pull request #263 from gdevanla/master
add TopLevel placeHolder to builtins module
2018-05-02 14:19:10 -07:00
Evan Laforge f806ecc5a2 fix bug that made genEvalCompareTests not run any eval-compare tests 2018-04-29 16:50:13 -07:00
Guru Devanla eefc698bde fix type of builtin.placeholder, add tests 2018-04-29 15:10:52 -07:00
Ian-Woo Kim 5de8976d1e add test for div 2018-04-28 14:23:50 -07:00
John Wiegley 7282d7c153 Define builtins.langVersion == 5 (integer), add a matching test with Nix
Fixes #235
2018-04-27 20:55:03 -07:00
John Wiegley 3cf02e3902 Track value provenance during evaluation 2018-04-22 14:33:38 -07:00
John Wiegley 86b09103d6 Move production of a reduced test case to --reduce, improve --trace 2018-04-20 22:36:40 -07:00
John Wiegley 02ee1c7e34 The argument order for the function passed to foldl' had gotten flipped 2018-04-17 18:30:05 -07:00
John Wiegley 4853381832 Add a new case_fixed_points test, based on an example from fixed-points.nix 2018-04-17 18:11:30 -07:00
John Wiegley 03c86aa872 Allow comparison of more value types in the tests 2018-04-17 18:11:26 -07:00
John Wiegley c3f34e62ce Use verbosity to control how much is displayed in error messages 2018-04-17 17:25:59 -07:00
John Wiegley 169a2140dd Add to the imports listed in Nix.hs 2018-04-14 09:39:03 -07:00
John Wiegley eadf714036 If MATCHING_TESTS=yes (default for Travis), compare eval tests to Nix 2018-04-13 22:34:24 -07:00
Ryan Trinkle 7889e2a9e8 Add a couple of tests for inherit scoping 2018-04-14 00:14:26 -04:00
John Wiegley 58b65d2ce1 Don't evaluate to normal form by default in the top level evaluators 2018-04-13 19:29:18 -07:00
John Wiegley 9a089712aa Create new __includes builtin, set by --include/-I 2018-04-11 22:02:31 -07:00
John Wiegley 3233c9cb31 Restore the pretty show instance for NValue m (orphaned in Pretty for now) 2018-04-10 21:11:46 -07:00
John Wiegley 58345c29f9 Mark ind-string-14.nix as broken, since I have no answer for it now 2018-04-10 18:20:58 -07:00
John Wiegley 2a6ba86ad5 Capitalize a test category name 2018-04-10 17:15:23 -07:00
John Wiegley dcd081d899 Add directory dependency for the tests 2018-04-10 12:38:14 -07:00
Doug Beardsley 13fc5bcd6d Add builtins.split
Finishes issue #113
2018-04-10 12:33:31 -07:00
John Wiegley 9d7f25d368 All is building with Megaparsec now, but many parsing tests fail 2018-04-09 17:12:16 -07:00
Doug Beardsley 1b7dac071d Test to catch a bug in builtins.match
Also added infrastructure for comparing against current nix behavior,
not just current nix tests.
2018-04-07 15:07:09 -07:00
John Wiegley d9047cc216 Factor out some code into new module Nix.Value 2018-04-07 11:38:12 -07:00
Ryan Trinkle 49a5b613d1 Use non-tracing evaluator in tests 2018-04-04 02:00:15 -04:00
Ryan Trinkle c506464d99 Fix default_value_in_atpattern
Default values are *not* added to @-bound variables in Nix (checked with nix-repl)
2018-04-03 22:21:19 -04:00
John Wiegley 973d6d873b Add an evaluation test for issue #108 2018-04-03 14:43:40 -07:00
John Wiegley c3eb7a94b9 Add basic support for quasi-quotation of Nix expressions in Haskell 2018-04-03 14:21:33 -07:00
John Wiegley ffb97610db Generalize the thunking mechanism, so it can be used over Symbolics 2018-04-01 23:48:07 -07:00
John Wiegley d7228c6a75 Move language feature pragmas into each Haskell file, not .cabal 2018-04-01 22:49:12 -07:00
John Wiegley d08ca26da0 Add informative backtraces on evaluation failure 2018-03-30 23:10:44 -07:00
John Wiegley 74cc1a2ad5 Split MonadNix into evaluation and environmental effects 2018-03-30 14:25:03 -07:00
John Wiegley 9f6c2ba948 Move a lot of code around into new modules 2018-03-30 14:08:38 -07:00
John Wiegley 8e944cc223 Fix the tests 2018-03-30 02:00:36 -07:00
John Wiegley 4e698d76fa More fixes to lazy evaluation and scoping 2018-03-30 01:11:27 -07:00
John Wiegley 8f24c7b645 Implement laziness, although without support for concurrency 2018-03-29 15:35:12 -07:00
John Wiegley 84918aa1d3 Remove the MonadFix requirement, it was not needed; fix NRecSet 2018-03-28 23:52:07 -07:00
John Wiegley 39f772ef3c Restore monadic abstraction (to support importFile), fix attribute sets 2018-03-28 14:45:10 -07:00
John Wiegley 124530c9a9 Fix at-right patterns 2018-03-27 22:53:52 -07:00
John Wiegley 3a29249e43 Normalize import statements, add option parsing 2018-03-27 21:59:27 -07:00
John Wiegley 1e0e47d064 Remove monadic context from evalExpr: we weren't using it! 2018-03-27 19:07:08 -07:00
John Wiegley 278916a9ab Further work on argument evaluation 2018-03-27 18:42:31 -07:00
John Wiegley ecd18e3da3 Merge branch 'master' into fix-recursive-argument-set 2018-03-27 14:34:28 -07:00
Georges Dubus 2e26bd75a5 Fix a bug where defaultargs are absent from the atpattern argument 2018-03-11 12:15:33 +01:00
Georges Dubus 0f7332636e Add support for variadic parameters
Everything was already in place, but not used for variadic parameters.

On the other hand fixed parameters sets are currently bugged, as they don't
reject extra arguments (they act like variadic parameters set). This commit adds
a TODO mentionning that.
2018-03-09 14:09:43 +01:00
Georges Dubus 6a8ae208b4 Use environment in evaluation of function definitions 2018-03-01 20:04:54 +01:00
Georges Dubus e73fc5d196 More WIP 2018-02-13 15:49:46 +01:00
Georges Dubus 7b651303e2 WIP fix recursive default args 2018-01-29 19:56:58 +01:00
Georges Dubus b61b5791bb Change the environment in evaluation to be a Map Text (NValue m)
Currently, the environment is passed as a `NValue m`, but is assumed to be
a set every single time it is used. This commit changes it `Map Text (NValue
m)`. Since this is used a lot, it defines a new type alias:

```
type ValueSet m = Map.Map Text (NValue m)
```

This has multiples benefits:
- Simplify some code by removing all the checks that the env is indeed a set
- Simplify the usage of the module by making clear that we need a set as the
  environment. (I especially like this, since it took me a while to figure out
  what that argument was supposed to be the first time).
- Make it simple to inject functions in the environment (for example to have
  builtins) since now the function definition doesn't need to unwrap the set.
2018-01-28 23:27:33 +01:00
Allen Nelson 50a3d0d0db make tests pass 2016-01-23 15:51:34 -06:00