summaryrefslogtreecommitdiff
path: root/test-suite/tests
AgeCommit message (Collapse)AuthorFilesLines
2013-03-30Merge remote-tracking branch 'origin/stable-2.0'Mark H Weaver1-177/+177
2013-03-29build: Build and check (ice-9 popen) only when --enable-posix and HAVE_FORK.Ludovic Courtès1-177/+177
Fixes <http://bugs.gnu.org/13848>. Reported by Jan Schukat <shookie@email.de>. * configure.ac: Rename `HAVE_FORK' conditional to `BUILD_ICE_9_POPEN'. Set it when both $enable_posix and $ac_cv_func_fork are true. * libguile/posix.c (scm_init_posix): Add the `fork' feature. * doc/ref/api-options.texi (Common Feature Symbols): Add `fork'. * doc/ref/posix.texi (Pipes): Add footnote mentioning the `fork' feature. * module/Makefile.am (SCRIPTS_SOURCES): Make `scripts/autofrisk.scm' and `scripts/scan-api.scm' conditional on `BUILD_ICE_9_POPEN'. * test-suite/tests/popen.test (if-supported): New macro. Wrap body in `if-supported'.
2013-03-28Merge remote-tracking branch 'origin/stable-2.0'Mark H Weaver1-24/+26
2013-03-28tests: Fix file name canonicalization tests for when $srcdir contains symlinks.Ludovic Courtès1-24/+26
* test-suite/tests/ports.test ("%file-port-name-canonicalization"): Use `pass-if-equal' instead of `pass-if'. ["relative canonicalization from ice-9"]: Throw to `unresolved' when %LOAD-PATH is not canonical. ["absolute canonicalization from ice-9"]: Canonicalize the result.
2013-03-28Merge remote-tracking branch 'origin/stable-2.0'Mark H Weaver29-241/+1548
Conflicts: configure.ac libguile/deprecated.c libguile/deprecated.h libguile/filesys.h libguile/fluids.c libguile/fports.c libguile/gc.c libguile/guile.c libguile/numbers.c libguile/objcodes.c libguile/r6rs-ports.c libguile/smob.c libguile/socket.c libguile/threads.h module/language/scheme/decompile-tree-il.scm module/language/tree-il/peval.scm test-suite/tests/syncase.test
2013-03-27Add SRFI-41.Chris K. Jester-Young1-0/+680
Incorporates suggestions from Mark H Weaver <mhw@netris.org> and Ian Price <ianprice90@googlemail.com>. * module/srfi/srfi-41.scm: New file. * module/Makefile.am (SRFI_SOURCES): Add srfi/srfi-41.scm. * test-suite/tests/srfi-41.test: New file. * test-suite/Makefile.am (SCM_TESTS): Add tests/srfi-41.test. * doc/ref/srfi-modules.texi (SRFI Support): Add SRFI-41. (SRFI-41): New node which refers the reader to <http://srfi.schemers.org/srfi-41/srfi-41.html>.
2013-03-27futures: Limit the number of nested futures on the same stack.Ludovic Courtès2-13/+14
Fixes <http://bugs.gnu.org/13188>. Reported by Nala Ginrut <nalaginrut@gmail.com>. * module/ice-9/futures.scm (%nesting-level): Rename to... (%nesting-level): ... this. Default to 0 instead of #f. Update users. (%max-nesting-level): New variable. (touch): When FUTURE is queued and (%nesting-level) is above %MAX-NESTING-LEVEL, abort to %FUTURE-PROMPT. * test-suite/tests/future.test ("nested futures")["loop"]: Remove `compile' call. * test-suite/tests/threads.test ("par-map")["long list"]: New test. * doc/ref/api-scheduling.texi (Futures): Add a paragraph about stack consumption.
2013-03-27web http: parse numeric time zones in headersDaniel Hartwig1-0/+3
* module/web/http.scm (parse-zone-offset, normalize-date): New procedures. (parse-rfc-822-date, parse-rfc-850-date, parse-date): Update. * test-suite/tests/web-http.test ("general headers"): Add test. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2013-03-26SRFI-45: add promise? predicate.Mark H Weaver1-1/+9
* module/srfi/srfi-45.scm (promise?): Export. * doc/ref/srfi-modules.texi (SRFI-45): Update docs. * test-suite/tests/srfi-45.test: Add test. Add FSF copyright for 2010 and 2013. Add missing year to André van Tonder's copyright notice.
2013-03-26Revert "SRFI-45: Support multiple values; add promise? predicate."Mark H Weaver1-42/+1
This reverts commit 1d64b4edb9da4011ad06c0fab1c6225ec20b0876.
2013-03-25SRFI-37: Fix infinite loop when processing short option with no required arg.Ludovic Courtès1-1/+23
Fixes <http://bugs.gnu.org/13176>. * module/srfi/srfi-37.scm (args-fold)[short-option-argument]: When ARGS is a pair, always set it to its cdr. * test-suite/tests/srfi-37.test ("SRFI-37")["short option with optional argument omitted", "short option with optional argument provided"]: New tests.
2013-03-25Skip relevant `sendfile' tests when thread support is lacking.Ludovic Courtès1-30/+34
* test-suite/tests/filesys.test ("sendfile")["pipe", "pipe with offset"]: Throw to `unresolved' when not (provided? 'threads).
2013-03-22tests: Add more `maybe-gc-flakiness'.Ludovic Courtès1-2/+2
Fixes <http://bugs.gnu.org/14001>. Reported by Dennis Clarke <dclarke@blastwave.org>. * test-suite/tests/gc.test ("gc")["Lexical vars are collectable"]: Wrap in `maybe-gc-flakiness'.
2013-03-22Add bindings for `sendfile'.Ludovic Courtès1-2/+68
* configure.ac: Check for <sys/sendfile.h> and `sendfile'. * libguile/filesys.c (scm_sendfile): New function. * libguile/filesys.h (scm_sendfile): New declaration. * test-suite/tests/filesys.test ("sendfile"): New test prefix. * doc/ref/posix.texi (File System): Document `sendfile'.
2013-03-22texinfo: Add whitespace after periods.Ludovic Courtès2-3/+10
* module/texinfo/string-utils.scm (end-of-sentence?): New procedure. (make-text-wrapper): Append an extra space after LINE when it matches `end-of-sentence?' and COLLAPSE-WHITESPACE? is false. * test-suite/tests/texinfo.serialize.test ("test-serialize"): Adjust accordingly. * test-suite/tests/texinfo.string-utils.test ("text wrapping")["two spaces after end of sentence"]: New test prefix.
2013-03-21test suite: Fix typo in `texinfo.test'.Ludovic Courtès1-1/+1
* test-suite/tests/texinfo.test ("test-texinfo->stexinfo"): Add missing quote.
2013-03-21texinfo: Recognize `@:'.Ludovic Courtès1-0/+2
* module/texinfo.scm (read-command-token): Recognize @:. * test-suite/tests/texinfo.test ("test-texinfo->stexinfo"): Add test.
2013-03-21texinfo: Allow markup in the arguments of `@pxref'.Ludovic Courtès1-0/+3
* module/texinfo.scm (texi-command-specs)[pxref]: Change to `INLINE-TEXT-ARGS'. * test-suite/tests/texinfo.test ("test-texinfo->stexinfo")["@pxref{Locales, @code{setlocale}}"]: New test.
2013-03-21test suite: Use `pass-if-equal' in texinfo.test.Ludovic Courtès1-31/+30
* test-suite/tests/texinfo.test: Replace occurrences of `(pass-if (equal? ...))' by `pass-if-equal'.
2013-03-20Improve sqrt handling of large integers and large and small rationals.Mark H Weaver1-1/+36
* libguile/numbers.c (exact_integer_is_perfect_square, exact_integer_floor_square_root): New static functions. (scm_sqrt): Use SCM_LIKELY. Add 'scm_t_inum' variable in inum case to reduce the number of uses of SCM_I_INUM. Rename 'mpz_t' variable. Remove unneeded sign check. Handle bignums too large to fit in a double. Handle fractions too large or too small to fit in a normalized double. * test-suite/tests/numbers.test ("sqrt"): Add tests.
2013-03-20Sqrt returns exact results when possible.Mark H Weaver1-1/+39
* libguile/numbers.c (scm_sqrt): Handle exact integers and rationals in such a way that exact results are returned whenever possible. * test-suite/tests/numbers.test ("sqrt"): Add tests.
2013-03-19SRFI-45: Support multiple values; add promise? predicate.Mark H Weaver1-1/+42
* module/srfi/srfi-45.scm (eager): Accept any number of arguments. Store the list of arguments in the value record. Previously, only one argument was accepted, and that value was stored in the value record. (delay): Support expressions that return any number of arguments. (force): Return the list of values stored in the value record. (promise?): Export. * doc/ref/srfi-modules.texi (SRFI-45): Update docs. Remove typing for simplicity in discussing multiple values. * test-suite/tests/srfi-45.test: Add tests. Add FSF copyright for 2010 and 2013. Add missing year to André van Tonder's copyright notice.
2013-03-19Use scientific notation only if there are enough trailing zeroes.Mark H Weaver1-0/+4
* libguile/numbers.c (idbl2str): Print large numbers in scientific notation only if the exponent is >= 7 and the least significant non-zero digit has value >= radix^4. * test-suite/tests/numbers.test ("number->string"): Add tests.
2013-03-17Reimplement idbl2str number printer.Mark H Weaver1-22/+75
Fixes <http://bugs.gnu.org/13757>. * libguile/numbers.c (idbl2str): Reimplement. (mem2decimal_from_point): Accept negative exponents larger than SCM_MAXEXP that produce subnormals. (SCM_MAX_DBL_PREC): Removed preprocessor macro. (scm_dblprec, fx_per_radix): Removed static variables. (init_dblprec, init_fx_radix): Removed static functions. (scm_init_numbers): Remove initialization code for 'scm_dblprec' and 'fx_per_radix'. * test-suite/tests/numbers.test ("number->string"): Restore tests that previously failed. Remove comments about problems in the number printer that are now fixed.
2013-03-17Improve inexact division of exact integers.Mark H Weaver1-1/+131
* libguile/numbers.c (scm_i_divide2double): New function. (scm_i_divide2double_lo2b): New variable. (scm_i_fraction2double, log_of_fraction): Use 'scm_i_divide2double'. (do_divide): Removed. Its code is now in 'scm_divide'. (scm_divide2real): Removed. Superceded by 'scm_i_divide2double'. (scm_divide): Inherit code from 'do_divide', but without support for forcing a 'double' result (that functionality is now implemented by 'scm_i_divide2double'). Add FIXME comments in cases where divisions might not be as precise as they should be. (scm_init_numbers): Initialize 'scm_i_divide2double_lo2b'. * test-suite/tests/numbers.test (dbl-epsilon-exact, dbl-max-exp): New variables. ("exact->inexact"): Add tests. ("inexact->exact"): Add test for largest finite inexact.
2013-03-16http: support IP-literal (IPv6 address) in Host headerDaniel Hartwig1-0/+4
* module/web/http.scm ("Host"): Parse and write IP-literals treating escapes as uri module does: remove brackets on parse, replace them on write. * test-suite/tests/web-http.test ("request headers"): Add tests.
2013-03-16add tests for read-request-line, etc.Daniel Hartwig1-0/+107
* test-suite/web/web-http.test ("read-request-line"): ("write-request-line", "read-response-line", "write-response-line"): Add.
2013-03-13add #:resolve-syntax-parameters? kwarg to syntax-local-bindingAndy Wingo1-1/+26
* doc/ref/api-macros.texi (Syntax Transformer Helpers): Document. * module/ice-9/psyntax.scm (syntax-local-binding): Add #:resolve-syntax-parameters? kwarg. Fixes bug 10991. * module/ice-9/psyntax-pp.scm: Regenerate. * test-suite/tests/syncase.test ("syntax-local-binding"): Add test.
2013-03-13failing to load module in psyntax indicates an identifier is not macroAndy Wingo1-1/+11
* module/ice-9/boot-9.scm (false-if-exception): Add optional #:warning TEMPLATE ARG... tail, which indicates that we should print a warning on failure. (load-in-vicinity): Use the new #:warning. (make-autoload-interface): Surround the bits that load modules with a false-if-exception with #:warning. Fixes http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12202. * test-suite/tests/syncase.test ("missing autoloads do not foil psyntax"): Add a test.
2013-03-12Reimplement 'inexact->exact' to avoid mpq functions.Mark H Weaver1-14/+66
* libguile/numbers.c (scm_inexact_to_exact): Implement conversion of a double to an exact rational without using the mpq functions. * test-suite/tests/numbers.test (dbl-mant-dig): Simplify initializer. (dbl-epsilon, dbl-min-exp): New variables. ("inexact->exact"): Add tests. Fix broken "2.0**i to exact and back" test, and change it to "2.0**i to exact", to avoid use of 'exact->inexact'.
2013-03-12Simplify and improve scm_i_big2dbl, and add scm_i_big2dbl_2expMark H Weaver1-13/+44
* libguile/numbers.c (scm_i_big2dbl_2exp): New static function. (scm_i_big2dbl): Reimplement in terms of 'scm_i_big2dbl_2exp', with proper rounding. * test-suite/tests/numbers.test ("exact->inexact"): Add tests.
2013-03-12Add 'round-ash', a rounding arithmetic shift operatorMark H Weaver1-65/+49
* libguile/numbers.c (left_shift_exact_integer, floor_right_shift_exact_integer, round_right_shift_exact_integer): New static functions. (scm_round_ash): New procedure. (scm_ash): Reimplement in terms of 'left_shift_exact_integer' and 'floor_right_shift_exact_integer'. * libguile/numbers.h: Add prototype for scm_round_ash. Rename the second argument of 'scm_ash' from 'cnt' to 'count'. * test-suite/tests/numbers.test (round-ash, ash): Add new unified testing framework for 'ash' and 'round-ash'. Previously, the tests for 'ash' were not very comprehensive; for example, they did not include a single test where the number to be shifted was a bignum. * doc/ref/api-data.texi (Bitwise Operations): Add documentation for 'round-ash'. Improve documentation for `ash'.
2013-03-12Optimize and simplify fractions code.Mark H Weaver1-0/+6
* libguile/numbers.c (scm_exact_integer_quotient, scm_i_make_ratio_already_reduced): New static functions. (scm_i_make_ratio): Rewrite in terms of 'scm_i_make_ratio_already_reduced'. (scm_integer_expt): Optimize fraction case. (scm_abs, scm_magnitude, scm_difference, do_divide): Use 'scm_i_make_ratio_already_reduced'. * test-suite/tests/numbers.test (expt, integer-expt): Add tests.
2013-03-09allow case-lambda expressions with no clausesAndy Wingo1-0/+13
* module/ice-9/psyntax-pp.scm: * module/ice-9/psyntax.scm (case-lambda, case-lambda*): Allow 0 clauses. * module/language/scheme/decompile-tree-il.scm (do-decompile): (choose-output-names): * module/language/tree-il.scm (unparse-tree-il): (tree-il-fold, post-order!, pre-order!): * module/language/tree-il/effects.scm (make-effects-analyzer): * module/language/tree-il/cse.scm (cse): * module/language/tree-il/debug.scm (verify-tree-il): * module/language/tree-il/peval.scm (peval): Allow for lambda-body to be #f. * libguile/memoize.c (memoize): * module/language/tree-il/canonicalize.scm (canonicalize!): Give a body to empty case-lambda before evaluating it or compiling it, respectively. * test-suite/tests/optargs.test ("case-lambda", "case-lambda*"): Add tests.
2013-03-07Improve standards conformance of string->number.Mark H Weaver1-1/+11
Fixes <http://bugs.gnu.org/11887>. * libguile/numbers.c (mem2ureal): New argument 'allow_inf_or_nan'. Accept infinities and NaNs only if 'allow_inf_or_nan' is true and "#e" is not present. Check for "inf.0" or "nan." case-insensitively. Do not accept rationals with zero divisors. (mem2complex): Pass new 'allow_inf_or_nan' argument to 'mem2ureal', which is set if and only if a explicit sign was present. * test-suite/tests/numbers.test ("string->number"): Add tests.
2013-03-07support calls and tail-calls with more than 255 formalsAndy Wingo1-1/+17
* module/language/tree-il/compile-glil.scm (flatten-lambda-case): Support calls and tail-calls with more than 255 formals. * test-suite/tests/tree-il.test ("many args"): Add a test.
2013-03-01test-suite: eq-ness of numbers, characters is unspecifiedDaniel Hartwig12-56/+52
* test-suite/tests/00-socket.test: * test-suite/tests/alist.test: * test-suite/tests/elisp.test: * test-suite/tests/encoding-iso88591.test: * test-suite/tests/encoding-iso88597.test: * test-suite/tests/encoding-utf8.test: * test-suite/tests/hash.test: * test-suite/tests/i18n.test: * test-suite/tests/modules.test: * test-suite/tests/ports.test: * test-suite/tests/srfi-35.test: Make tests use eqv? instead of eq? when comparing numbers, characters. Checked also for similar uses of assq[-ref]. * test-suite/tests/vlist.test ("vhash-delete honors HASH"): Change test to use eqv-ness, not eq-ness, which should not impact its purpose as these two are equivalent for strings.
2013-02-28Fix later-bindings-win logic in with-fluids.Mark H Weaver1-4/+6
Based on a patch by David Kastrup <dak@gnu.org>. Fixes <http://bugs.gnu.org/13843>. * libguile/fluids.c (scm_i_make_with_fluids): Reverse direction of inner loop that checks for duplicates, to properly handle more than two bindings to the same fluid.
2013-02-28Fix duplicate removal of with-fluids.Mark H Weaver1-8/+22
Based on a patch by David Kastrup <dak@gnu.org>. Fixes <http://bugs.gnu.org/13838>. * libguile/fluids.c (scm_i_make_with_fluids): Remove the duplicate binding instead of the last binding. * test-suite/tests/fluids.test: Add test, and fix existing duplicate tests. * THANKS: Thanks David Kastrup.
2013-02-28Fix handling of the *-gnux32 target.Ludovic Courtès1-1/+5
* module/system/base/target.scm (triplet-pointer-size): Fix typo in the x32 triplet name. * test-suite/tests/asm-to-bytecode.test (native-os): New procedure. (test-target): Use (native-word-size) only when both the CPU and OS match.
2013-02-27Recognize the `x86_64.*-gnux32' triplet.Ludovic Courtès1-0/+2
* module/system/base/target.scm (triplet-pointer-size): Add case for "^x64_64-.*-gnux32". * test-suite/tests/asm-to-bytecode.test ("cross-compilation"): ["x86_64-unknown-linux-gnux32"]: New test.
2013-02-27Check whether a triplet's OS part specifies an ABI.Ludovic Courtès1-0/+2
* module/system/base/target.scm (cpu-word-size): Rename to... (triplet-pointer-size): ... this. Update caller. Take a triplet as the argument. Check the `triplet-os' part when checking for equality with the host. Add support "mips64.*-gnuabi64". * test-suite/tests/asm-to-bytecode.test ("cross-compilation") [ "mips64el-unknown-linux-gnuabi64"]: New test.
2013-02-27Recognize mips64* as having 32-bit pointers by default.Ludovic Courtès1-1/+4
* module/system/base/target.scm (cpu-word-size): Consider MIPS64 to default to n32 or o32. * test-suite/tests/asm-to-bytecode.test ("cross-compilation") ["mips64el-unknown-linux-gnu"]: New test.
2013-02-18Remove flawed test that assumed (eq? 1/2 2/4) would return false.Mark H Weaver1-5/+1
* test-suite/tests/hash.test ("hash-count"): Remove flawed test.
2013-02-18Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo7-69/+215
Conflicts: libguile/array-handle.c libguile/deprecated.h libguile/inline.c libguile/inline.h module/ice-9/deprecated.scm module/language/tree-il/peval.scm
2013-02-18deprecate generalized vectors in favor of arraysAndy Wingo4-61/+38
* libguile/generalized-arrays.h: * libguile/generalized-arrays.c (scm_c_array_length): (scm_array_length): New functions. * module/ice-9/deprecated.scm: * libguile/generalized-vectors.c: * libguile/generalized-vectors.h: * libguile/deprecated.h: * libguile/deprecated.c (scm_generalized_vector_p) (scm_generalized_vector_length, scm_generalized_vector_ref) (scm_generalized_vector_set_x, scm_generalized_vector_to_list): Deprecate. * libguile/uniform.c (scm_uniform_vector_to_list): Use scm_array_to_list. * module/ice-9/boot-9.scm (case): Arrays are generalized vectors. * module/srfi/srfi-4/gnu.scm (define-any->vector): Use the array functions instead of the generalized-vector functions. * test-suite/tests/arrays.test: Remove generalized-vector->list test; covered by array->list test. * test-suite/tests/bitvectors.test: * test-suite/tests/bytevectors.test: * test-suite/tests/srfi-4.test: Adapt to test using array interfaces instead of generalized-vector interfaces. * doc/ref/api-compound.texi: Remove generalized vector docs. * doc/ref/api-data.texi: * doc/ref/srfi-modules.texi: Adapt.
2013-02-18optimize access to arrays of rank 1 or 2Andy Wingo1-2/+2
* libguile/array-handle.c (scm_array_handle_pos_1): (scm_array_handle_pos_2): New functions. * libguile/generalized-arrays.c (scm_c_array_ref_1, scm_c_array_ref_2): (scm_c_array_set_1_x, scm_c_array_set_2_x): New functions. (scm_i_array_ref, scm_i_array_set_x): New subr bindings for array-ref and array-set! that avoid consing for arrays of rank 1 or 2. * test-suite/tests/arrays.test ("array-set!"): Fix expected exception for wrong number of indices.
2013-02-18add hash-count for native tablesDaniel Hartwig1-0/+16
* libguile/hashtab.c (scm_hash_count): New function. Count the number of elements in a hash table. * doc/ref/api-compound.texi (Hash Tables): Update examples and reference. * test-suite/tests/hash.test (hash-count): New test.
2013-02-15local rewrite for apply to a let-bound rest listAndy Wingo1-5/+26
* module/language/tree-il/peval.scm (peval): Add a special-case inlining pattern for apply to a let-bound rest arg that preserves effect ordering. * test-suite/tests/peval.test ("partial evaluation"): Add a test, and update an older test with a better result.
2013-02-15inline call-with-values consumers with optional and/or rest argsAndy Wingo1-0/+7
* module/language/tree-il/peval.scm (peval): Inline call-with-values whose consumers have optional and rest arguments. * test-suite/tests/peval.test ("partial evaluation"): Add test.