Commit Graph

1591 Commits

Author SHA1 Message Date
c6eb0be990 Remove the negative number tests for bitwise not.
They were inadvertently relying on undefined behavior in C and we get
different results on some compilers.

Until we decide how we want the operation to behave, for now, just
leave it unspecified.
2017-01-12 22:17:33 -08:00
d301fefac2 Add a comment explaining the ci targets. 2017-01-12 21:55:35 -08:00
5ddd783ff5 Use strtoll() for hex literals to handle 64-bit ones even on 32-bit. 2017-01-12 21:53:21 -08:00
0cc00c41c0 Simplify test runner output a little. 2017-01-12 21:38:06 -08:00
33a73ef1d5 Avoid using fpclassify() to detect infinity and nan.
It's not supported in C++98. Instead, use isnan() and isinf(), which
seem to work? If nothing else, they are used elsewhere in Wren, so if
we're not going to use them here, we should fix the other places too.
2017-01-12 21:34:11 -08:00
e8dfb1bf10 Don't test bitwise operations on operands that don't fit in u32.
The current behavior is undefined in C when converting the double to a
u32, so the tests fail on some compilers. For now, I'm just removing
those parts of the tests because I'm not sure what I want the behavior
to be. Modulo? Truncate? Runtime error?
2017-01-12 21:32:50 -08:00
252265c80b Merge branch 'travis-build-configurations' of https://github.com/iwillspeak/wren into iwillspeak-travis-build-configurations 2017-01-12 20:19:52 -08:00
f03647cbf0 Merge branch 'gc-32-bugfix' of https://github.com/iwillspeak/wren into iwillspeak-gc-32-bugfix 2017-01-12 18:53:14 -08:00
479ca7ec6d Improve explanation of single-expression blocks.
Fix #390.
2017-01-12 11:05:03 -08:00
0a2bc4a8a7 More copy editing. 2017-01-12 07:11:01 -08:00
fc6a7e5d18 Tweak some docs a little. 2017-01-12 07:10:19 -08:00
a9f49b89a4 Fix Bug in GC Reallocation Calculation
Updates the way we calculate thenext GC to make sure that we're not
already past the threshold. This was causing endless garbage collections
on 32 bit builds in `test/language/deeply_nested_gc.wren`.
2016-12-29 17:53:27 +00:00
04a7c9b5c8 Improve Travis Build & Test Coverage
Build Wren for more targets, and run the test suite on both 32 and 64
bit builds.

 * Update the build config to test both with and without NAN_TAGGING
   defined.

 * Updatest `util/test.py` to take the executable suffix as a
   parameter. This allows the makefile to control which binaries will be
   tested.

   Adds a new target to the makefile to be run by travis, this runs the
   test suite against all of the configurations it builds.

 * Gcc on some 32 bit platforms was complaining about numeric overflows
   when -INFINITY was used. Update the logic for converting a double to
   a string to not explicitly check against the literal values.

 * Make CI builds run the tests on both 64 _and_ 32 bit builds.

 * If I limit the number of CPUs on my MBP I can get some of the tests
   to time out, I'm imagining that the specs of the Travis Macs means
   that the same is happening there too. Updated the test script to
   allow an extra few seconds for the test to complete successfully
   before killing it.

 * Due to slight differences in accuracy in some computations tests were
   failing on 32 bit builds. Stop comparing things quite as exactly in
   the cases where it is causing issues.

   For some reason 12.34 was refusing to compare equal to itself. Bad
   show 12.34 :-/. I've also updated the test so it doesn't leak handles
   even if the assertions fail.

 * Double-cast from `double` to `uint32_t` to prevent undefined
   behaviour on overflow of basic integers. This should hopefully
   prevent 32 bit test failures on Linux.

 * Move to a version of LibUV with a fix for the 32 bit build error on
   Travis.
2016-12-29 17:52:38 +00:00
cefb50f944 Fix Bug in GC Reallocation Calculation
Updates the way we calculate thenext GC to make sure that we're not
already past the threshold. This was causing endless garbage collections
on 32 bit builds in `test/language/deeply_nested_gc.wren`.
2016-12-29 17:52:38 +00:00
b9f53f71fb Reset API stack a fiber is aborted from wrenCall(). 2016-11-01 08:40:16 -07:00
51e50e6cc4 Free libuv data before resuming after an error. 2016-11-01 08:39:30 -07:00
a2868913c5 Add .log to Num 2016-10-31 17:22:32 -02:30
955e92761d Add .pow(_) to Num 2016-10-31 17:22:13 -02:30
2650794340 Update AUTHORS 2016-10-31 17:21:55 -02:30
a3aaad83ea Fix bug #362 calling Foreign methods
I assume that invoking callForeign that the apiStack should be restored
to it's original value, rather than reset to NULL.
2016-10-26 13:51:29 -04:00
57f34fab95 Fix assignment test. 2016-10-08 10:51:19 -07:00
e7cabbb5e4 Reset the API stack after a foreign constructor returns. 2016-08-28 08:23:27 -07:00
d331cbf43d Ensure macro parameter is parenthesized. 2016-08-27 21:44:39 -07:00
b59eeaf2d1 Support "--version" in the CLI to print the version. 2016-08-27 17:38:14 -07:00
09ef904d32 Use DBL_MIN instead of DBL_EPSILON for Num.smallest. 2016-08-27 17:25:32 -07:00
b8b0f36521 Merge branch 'num-properties' of https://github.com/Nelarius/wren into Nelarius-num-properties 2016-08-27 17:18:21 -07:00
0a4f1b370c Revise embedding docs a bit. 2016-08-26 07:11:50 -07:00
a8cf1c9d71 Const correct a couple of functions.
Thanks, Michel!
2016-08-16 07:43:54 -07:00
febb1b0437 Use a map to check for constant collisions.
Doing an O(n) lookup was too slow.
2016-08-16 07:43:34 -07:00
08eceb7382 Check for duplicates when adding constants.
This saves a little memory, but, more importantly, allows us to support
functions with large numbers of repeated constants.
2016-08-16 07:24:04 -07:00
6ee1743429 Update Num class doc 2016-08-04 21:17:45 +03:00
50fa77356e Add largest, smallest properties to Num class 2016-08-04 21:15:55 +03:00
500c7b0426 Add List constructors to docs. 2016-08-04 06:28:41 -07:00
3666eae013 Tweak new list constructors.
- Remove List.new(_). I was convinced by the issue discussion that
  using it is probably a bad idea. We don't want to encourage more nulls
  in the world than there are already are. So let's see if we can live
  without it and just have List.filled(). That way users think about
  what they're creating a list *of*.
- Added some more tests.
- Correctly handle being given a negative size.
2016-08-03 22:42:31 -07:00
3de394e8a1 Merge branch 'new-list-constructors' of https://github.com/mooxen/wren into mooxen-new-list-constructors 2016-08-03 22:34:08 -07:00
6845328661 Tweak String.indexOf(_,_) a bit.
- Simplify the arithmetic a little in wrenStringFind().
- Allow the start to be negative.
- Even more tests.
- Docs.
2016-08-03 22:19:34 -07:00
e5dce527ac Merge branch 'string-indexof-startindex' of https://github.com/underscorediscovery/wren into underscorediscovery-string-indexof-startindex 2016-08-03 21:51:46 -07:00
83bb043327 Merge branch 'forgotten-bytecode' of https://github.com/minirop/wren into minirop-forgotten-bytecode 2016-08-03 21:45:09 -07:00
60a0353a27 Tweak list C API:
- Rename "size" -> "count" to be consistent with other usage.
- Remove "Slot" from the function names, since that's implicit.
- Make the getListElement() just move the element to another slot. This
  matches other APIs where we distinguish accessing a value and
  converting it to some specific type.
2016-07-28 08:06:36 -07:00
b8675e2d91 Merge branch 'get_slot_list_values' of https://github.com/dradtke/wren into dradtke-get_slot_list_values 2016-07-28 07:53:19 -07:00
244faa5700 renamed filler constructor in list to match issue 2016-07-17 12:24:19 +10:00
45d9794476 added extra arguments to list constructors for default size/ value 2016-07-17 12:01:50 +10:00
1f84a10f44 Implement String indexOf(needle, startIndex) 2016-07-14 01:23:01 -02:30
193d102952 missed bytecode name refactoring 2016-07-12 22:59:02 +02:00
d192a9a02d Add doc mention of new Num properties 2016-07-10 23:26:23 +03:00
817a5650fe Add highest, lowest, epsilon properties to Num class 2016-07-10 22:54:34 +03:00
5418e4f8f3 Add MapEntry to core to let maps be directly iterated.
Fix #372.
2016-07-06 07:17:07 -07:00
fcfb053dc1 Merge branch 'verbose-make' of https://github.com/bfontaine/wren into bfontaine-verbose-make 2016-07-06 06:51:12 -07:00
d7524898dc Merge pull request #376 from paulsapps/master
Fix build, return false instead of NULL
2016-07-06 06:46:35 -07:00
5468d6d033 Fix build, return false instead of NULL 2016-07-02 12:40:00 +01:00