summaryrefslogtreecommitdiff
path: root/test-suite
Commit message (Collapse)AuthorAgeFilesLines
* temporarily disable elisp exception testsRobin Templeton2020-04-041-3/+3
| | | | | | | | (Best-ability ChangeLog annotation added by Christopher Allan Webber.) * test-suite/tests/elisp-compiler.test ("catch without exception" test) ("catch and throw" test, "unwind-protect" test): Switch from pass-if to expect-fail.
* ignore 'expect-fail' forms in elisp testsRobin Templeton2020-04-041-1/+3
| | | | | | | (Best-ability ChangeLog annotation added by Christopher Allan Webber.) * test-suite/tests/elisp-compiler.test (compile-test): Update to support expect-fail.
* update cross-compilation testRobin Templeton2020-04-041-2/+2
| | | | | | (Best-ability ChangeLog annotation added by Christopher Allan Webber.) * test-suite/tests/cross-compilation.test (test-target): Update it.
* Actually run '00-repl-server.test'.Ludovic Courtès2020-03-071-1/+2
| | | | | | | | | | This is a followup to ddcab06f20525d975503d8d9611e02021fb0dff1. Until now the tests would always be marked as unresolved because TMPDIR was removed before the client and server had been started. * test-suite/tests/00-repl-server.test (call-with-repl-server): Remove initial call to 'rmdir'. Add calls to 'delete-file' and 'rmdir' in the unwind handler.
* texinfo: Properly render @acronym in plain text.Ludovic Courtès2020-02-121-1/+19
| | | | | | | | | | | Fixes <https://bugs.gnu.org/37846>. Reported by Christopher Baines <mail@cbaines.net>. * module/texinfo/plain-text.scm (acronym): New procedure. (tag-handlers): Change 'acro' handle to ACRONYM, and add 'acronym' handler. * test-suite/tests/texinfo.plain-text.test ("stexi->plain-text") ["acronym", "recursive acronym"]: New tests.
* texinfo: Add '*line-width*' fluid to control line wrapping.Ludovic Courtès2020-02-122-0/+35
| | | | | | | | * module/texinfo/plain-text.scm (*line-width*): New variable. (wrap*): Honor it. * doc/ref/texinfo.texi (texinfo plain-text): Document it. * test-suite/tests/texinfo.plain-text.test: New file. * test-suite/Makefile.am (SCM_TESTS): Add it.
* 00-repl-server.test: don't use fixed path for socketRob Browning2020-01-221-4/+17
| | | | | * test-suite/tests/00-repl-server.test (make-tempdir): Add. (call-with-repl-server): Store socket in a make-tempdir dir.
* Respect thread local fluid defaultsRob Browning2020-01-121-2/+12
| | | | | | | | | | | | | Previously (fluid-ref (make-thread-local-fluid #t)) would return #f via scm_fluid_ref because the internal scm_hashq_ref would return #f when the fluid had not been set, and that was interpreted as an actual value for the fluid. Instead, just pass the fluid default as the default for the hash table lookups so that we don't need a second step to determine if the fluid was set. Thanks to Andrew Gierth for tracking down the problem.
* Fix peval bug that ignored excess argsAndy Wingo2020-01-121-2/+19
| | | | | | | | * module/language/tree-il/peval.scm (peval): Fix arity check for type confusion (empty value of "rest" in this context was (), not #f). The effect was that we'd silently allow extra arguments to inlined calls. Thanks to Christopher Lam for the report! Fixes #38617. * test-suite/tests/peval.test ("partial evaluation"): Add a test.
* 'strftime' and 'strptime' honor the locale encoding.Ludovic Courtès2019-06-301-4/+31
| | | | | | | | | | | | | | | Fixes <https://bugs.gnu.org/35920>. Reported by Christopher Lam <christopher.lck@gmail.com>. * libguile/stime.c (scm_strftime): Use 'scm_to_locale_stringn' instead of 'scm_to_utf8_stringn'. (scm_strptime): Likewise, and use 'scm_string_length' instead of 'u8_strnlen'. * test-suite/tests/time.test ("strftime")["strftime passes wide characters"]: Wrap body in 'with-locale'. ["strftime fr_FR.utf8", "strftime fr_FR.iso88591"]: New tests. ("strptime")["strftime fr_FR.utf8", "strftime fr_FR.iso88591"]: New tests.
* tests: Add (web server) test.Ludovic Courtès2019-06-302-0/+119
| | | | | * test-suite/tests/web-server.test: New file. * test-suite/Makefile.am (SCM_TESTS): Add it.
* Revert "web: Add support for HTTP header continuation lines."Mark H Weaver2019-06-241-10/+1
| | | | | | Fixes <https://bugs.gnu.org/36350>. This reverts commit 73cde5ed7218a090ecee888870908af5445796f0.
* web: Add support for HTTP header continuation lines.Mark H Weaver2019-06-181-1/+10
| | | | | | | * module/web/http.scm (spaces-and-tabs, space-or-tab?): New variables. (read-header-line): After reading a header, if a space or tab follows, read the continuation lines and join them. * test-suite/tests/web-http.test: Add test.
* time.test: Use 'pass-if-equal' in more tests.Mark H Weaver2019-06-181-16/+20
| | | | | * test-suite/tests/time.test ("strftime"): Change some uses of 'pass-if' to instead use 'pass-if-equal'.
* Make URI handling locale independent.Timothy Sample2019-06-041-3/+30
| | | | | | | | | | | | Fixes <https://bugs.gnu.org/35785>. * module/web/uri.scm (digits, hex-digits, letters): New variables. (ipv4-regexp, ipv6-regexp, domain-label-regexp, top-label-regexp, userinfo-pat, host-pat, ipv6-host-pat, port-pat, scheme-pat): Explicitly list each character instead of using character ranges. * test-suite/tests/web-uri.test: Add corresponding tests. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* 'basename' correctly handles "/" and "//".Ludovic Courtès2019-06-041-1/+7
| | | | | * libguile/filesys.c (scm_basename): Special-case "/" and "//". * test-suite/tests/filesys.test ("basename"): New test prefix.
* Strings, i18n: Limit the use of alloca to approximately 8 kilobytes.Mark H Weaver2019-05-072-1/+28
| | | | | | | | | | | | | * libguile/i18n.c (SCM_MAX_ALLOCA): New macro. (SCM_STRING_TO_U32_BUF): Accept an additional variable to remember whether we used malloc to allocate the buffer. Use malloc if the allocation size is greater than SCM_MAX_ALLOCA. (SCM_CLEANUP_U32_BUF): New macro. (compare_u32_strings, compare_u32_strings_ci, str_to_case): Adapt. * libguile/strings.c (SCM_MAX_ALLOCA): New macro. (normalize_str, unistring_escapes_to_r6rs_escapes): Use malloc if the allocation size is greater than SCM_MAX_ALLOCA. * test-suite/tests/i18n.test, test-suite/tests/strings.test: Add tests.
* Avoid 'with-latin1-locale' in binary I/O tests.Mark H Weaver2019-05-071-8/+7
| | | | | | * test-suite/tests/r6rs-ports.test ("put-bytevector [2 args]") ("put-bytevector [3 args]", "put-bytevector [4 args]"): Set the default port encoding instead of setting the locale.
* Disable test for current value of setitimer on CygwinMichael Gran2019-02-231-3/+12
| | | | | * test-suite/tests/signals.test ("current itimers are 0"): throws unresolved for cygwin
* Make locale monetary conversion tests be less strict on terminal whitespaceMichael Gran2019-02-231-2/+2
| | | | * test-suite/tests/i18n.test (monetary-amount->locale-string): modified
* Fix crypt-on-glibc test errorAndy Wingo2019-02-211-7/+14
| | | | | * test-suite/tests/posix.test ("crypt"): Allow for the given salt being valid. Thanks to Jonathan Brielmaier for the report and debugging!
* Fix binary output on files created by mkstemp!Mike Gran2019-02-091-2/+17
| | | | | | | Some operating systems require a O_BINARY flag. * libguile/filesys.c (scm_i_mkstemp): Don't mask out O_BINARY flag * test-suite/tests/posix.test ("binary mode honored"): new test
* Avoid leaking a file descriptor in test-unwindMike Gran2019-02-091-2/+5
| | | | * test-suite/standalone/test-unwind.c (check_ports): explicitly close temp file
* Don't mutate read-only string in ports testMike Gran2019-02-091-2/+2
| | | | * test-suite/tests/ports.test ("valid wide mode string"): modified
* Fix tests for SRFI-19 date->string ~NDaniel Llorens2018-12-121-6/+10
|
* Support ~N in SRFI-19 string->dateDaniel Llorens2018-12-111-0/+10
| | | | | | | | * module/srfi/srfi-19.scm (fractional-integer-reader, make-fractional-integer-reader): From reference implementation. (reader-directives): Handle #\N, from reference implementation. * test-suite/tests/srfi-19: Add tests for string->date ~N. * doc/ref/srfi-modules.texi (string->date): Add line for ~N.
* Update (ice-9 match) to include selected bug fixes from upstream.Mark H Weaver2018-11-111-0/+9
| | | | | | | | Fixes <https://bugs.gnu.org/22925> and other bugs. * module/ice-9/match.upstream.scm: Apply selected fixes from the upstream match.scm in Chibi-Scheme. * test-suite/tests/match.test.upstream: Add more tests from upstream.
* SRFI-19: Fix normalization of seconds and nanoseconds in time records.Mark H Weaver2018-10-211-0/+8
| | | | | | | | Fixes <https://bugs.gnu.org/26162>. Reported by Zefram <zefram@fysh.org>. * module/srfi/srfi-19.scm (time-normalize!): Rewrite. * test-suite/tests/srfi-19.test: Add tests.
* SRFI-19: Add a few more tests.Mark H Weaver2018-10-201-0/+4
| | | | | | This is a followup to commit a58c7abd72648f77e4ede5f62a2c4e7969bb7f95. * test-suite/tests/srfi-19.test: Add tests for large positive years.
* SRFI-19: Fix handling of negative years and negative julian days.Mark H Weaver2018-10-201-5/+48
| | | | | | | | | | | | | | | | | | | | | | | Fixes <https://bugs.gnu.org/21906>. Mitigates <https://bugs.gnu.org/21903> and <https://bugs.gnu.org/21904>. Reported by: Zefram <zefram@fysh.org>. * module/srfi/srfi-19.scm (encode-julian-day-number) (decode-julian-day-number, date-week-number): Use 'floor-quotient' instead of 'quotient', and 'floor' instead of 'truncate', where appropriate. (time-utc->date): Ensure that the 'nanoseconds' field of the returned date is non-negative. (leap-year): Handle negative years properly, and reformulate the computation. (week-day): Handle negative years properly. Use 'floor-quotient' instead of 'quotient' where appropriate. (directives): In the handler for '~Y' format escapes, improve the handling of years outside of the range 0-9999. (read-directives): Add a FIXME comment to fix the '~Y' reader to handle years outside of the range 0-9999. * test-suite/tests/srfi-19.test: Import (srfi srfi-1). Use Guile's modern keyword notation in the 'define-module' form. Add more tests.
* SRFI-19: Fix TAI->UTC conversions, leap second handling, etc.Mark H Weaver2018-10-201-2/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes <https://bugs.gnu.org/21911>. Fixes <https://bugs.gnu.org/22034>. Fixes <https://bugs.gnu.org/21902>. Partially fixes <https://bugs.gnu.org/21904>. Reported by Zefram <zefram@fysh.org>. * doc/ref/srfi-modules.texi (SRFI-19 Introduction): Fix the definitions of Julian Day and Modified Julian Day. Give the correct full names of UTC and TAI. * module/srfi/srfi-19.scm: Import (srfi srfi-1). Use modern Guile keyword syntax in the 'define-module' form. (leap-second-neg-delta): New procedure, derived from a similar procedure in the latest upstream SRFI-19 reference implementation. (priv:time-tai->time-utc!, time-tai->julian-day) (time-monotonic->julian-day): Use 'leap-second-neg-delta'. (local-tz-offset): Fix comment. (leap-second?): Remove. (tai-before-leap-second?): New procedure, derived from upstream SRFI-19. (time-utc->date): Use 'define*' to handle the optional argument. Remove the leap second handling, following upstream SRFI-19. (time-tai->date): Rewrite in terms of 'time-utc->date'. Add special leap second handling, following upstream SRFI-19. (time-monotonic->date): Rewrite in terms of 'time-tai->date'. (date->time-tai, date->time-monotonic): Add special leap second handling, following upstream SRFI-19. (directives): In the entry for the "~Y" escape in 'date->string', pad the year field to 4 characters, following upstream SRFI-19. * test-suite/tests/srfi-19.test: Add tests.
* Fix type inferencing for 'nil?' and 'null?' predicates.Mark H Weaver2018-10-191-1/+50
| | | | | | | | | | | | | | | | | | Fixes <https://bugs.gnu.org/33036>. Reported by <calcium@disroot.org>. * module/language/cps/types.scm (define-simple-type-inferrer): Apply (logand (&type val) <>) uniformly. Previously, this was done only in the false branch. Rename local variable to 'type*', to allow the macro operand 'type' to be an arbitrary expression. (*type-inferrers*)<null?>: Add &nil to the set of possible types. (*type-inferrers*)<nil?>: Add &false and &null to the set the possible types. * module/language/cps/type-fold.scm (*branch-folders*)<null?>: Add &nil to the set of possible types. (*branch-folders*)<nil?>: Add &false and &null to the set the possible types. * test-suite/tests/compiler.test: Add tests.
* In 'ash' and 'round-ash', handle right shift count of LONG_MIN.Mark H Weaver2018-10-141-0/+24
| | | | | | | | | | | | Fixes <https://bugs.gnu.org/21901>. Reported by Zefram <zefram@fysh.org>. * libguile/numbers.c: Add another top-level 'verify' to ensure that LONG_MIN is not a fixnum. (scm_ash, scm_round_ash): Ensure that when the shift count is LONG_MIN, it is not handled via the normal code path, to avoid signed overflow when the shift count is negated. * test-suite/tests/numbers.test: Add tests.
* Fix 'round-ash' of negative integers by huge right shift counts.Mark H Weaver2018-10-141-5/+5
| | | | | | | | | | | | | | This is a followup to commit 011aec7e240ef987931548d90c53e6692c85d01c. When rounding, right shifting a negative integer by a huge shift count results in 0, not -1. * libguile/numbers.c: Add top-level 'verify' to ensure that the assumptions in 'scm_ash' and 'scm_round_ash' are valid. (scm_round_ash): In the case that handles huge right shifts, require that the shift count _exceeds_ the integer length, and return 0 instead of -1. * test-suite/tests/numbers.test: Adjust tests accordingly.
* Gracefully handle huge shift counts in 'ash' and 'round-ash'.Mark H Weaver2018-10-141-2/+22
| | | | | | | | | | | | Fixes <https://bugs.gnu.org/32644>. Reported by Stefan Israelsson Tampe <stefan.itampe@gmail.com>. The need for this arose because the type inferrer for 'ursh' sometimes passes (- 1 (expt 2 64)) as the second argument to 'ash'. * libguile/numbers.c (scm_ash, scm_round_ash): Gracefully handle several cases where the shift count does not fit in a C 'long'. * test-suite/tests/numbers.test: Add tests.
* Fix list validation of *list->bytevector procedures.Mark H Weaver2018-10-141-5/+32
| | | | | | | | | | | | Fixes <https://bugs.gnu.org/32938>. Reported by Josh Datko <jbd@cryptotronix.com>. * libguile/validate.h (SCM_VALIDATE_LIST_COPYLEN) (SCM_VALIDATE_NONEMPTYLIST_COPYLEN): Use '!=' instead of '>=' to validate the result of 'scm_ilength' after it has been stored in the user variable 'cvar'. * test-suite/tests/bytevectors.test: Add tests. Use '#:use-module' instead of ':use-module' in 'define-module' form.
* Define AT_SYMLINK_NOFOLLOW et al.Ludovic Courtès2018-09-231-2/+17
| | | | | | | | * libguile/posix.c (scm_init_posix): Define AT_SYMLINK_NOFOLLOW, AT_SYMLINK_FOLLOW, AT_NO_AUTOMOUNT, and AT_EMPTY_PATH when available. (scm_utime): Mention AT_SYMLINK_NOFOLLOW. * doc/ref/posix.texi (File System): Update accordingly. * test-suite/tests/posix.test ("utime")["AT_SYMLINK_NOFOLLOW"]: New test.
* Add -Wshadowed-toplevel.Ludovic Courtès2018-07-241-1/+83
| | | | | | | | | | | | * module/language/tree-il/analyze.scm (shadowed-toplevel-analysis): New variable. * module/language/tree-il/compile-cps.scm (%warning-passes): Add it. * module/system/base/message.scm (%warning-types): Add it. * test-suite/tests/tree-il.test ("warnings")["shadowed-toplevel"]: New test prefix. * module/ice-9/boot-9.scm (%auto-compilation-options): Add it. * doc/ref/api-evaluation.texi (Compilation): Add 'shadowed-toplevel' and 'macro-use-before-definition'.
* r6rs-ports: Accept 'port-position' values greater than 2^32.Ludovic Courtès2018-07-191-1/+11
| | | | | | | | | | Reported by Ricardo Wurmus <rekado@elephly.net>. Fixes <https://bugs.gnu.org/32161>. * libguile/r6rs-ports.c (custom_binary_port_seek): Use 'scm_to_off_t' instead of 'scm_to_int'. * test-suite/tests/r6rs-ports.test ("8.2.7 Input Ports")["custom binary input port position, long offset"]: New test.
* types: Recognize 'scm_t_port_type' and decode port type name.Ludovic Courtès2018-06-241-3/+28
| | | | | | | | | | * module/system/base/types.scm (read-c-string, inferior-port-type): New procedures. (inferior-port): Use 'inferior-port-type' to determine the port type. (cell->object): Rename 'flags+type' to 'flags' in the '%tc7-port' case. * test-suite/tests/types.test ("opaque objects"): Adjust port testse. (test-inferior-ports): New macro. ("ports"): New test prefix.
* tests: Adjust i18n.test to 'fr_FR.utf8' locale in glibc 2.27.Ludovic Courtès2018-06-181-24/+42
| | | | | | | | | * test-suite/tests/i18n.test (french-number-string=?): New procedure. ("number->locale-string")["French"]("integer", "negative integer") ("fraction", "fraction, 1 digit"): Use it. ("format ~h")["French"]("12345.678"): Likewise. ("monetary-amount->locale-string")["French"]("integer", "fraction"): Check for both SPACE and NO-BREAK SPACE.
* tests: Add SRFI-71 test.Ludovic Courtès2018-06-182-0/+47
| | | | | * test-suite/tests/srfi-71.test: New file. * test-suite/Makefile.am (SCM_TESTS): Add it.
* srfi-18: 'thread-sleep!' timeout-as-a-number is relative.Ludovic Courtès2018-02-161-3/+2
| | | | | | | | | | This is a followup to <https://bugs.gnu.org/29704>. * module/srfi/srfi-18.scm (thread-sleep!): When TIMEOUT is a number, keep it as-is. * test-suite/tests/srfi-18.test ("thread sleep with number"): Pass 0 as the timeout. ("thread sleeps fractions of a second"): Pass 0.5 as the timeout.
* srfi-18: When timeout is a number, it's a relative number of seconds.Ludovic Courtès2018-02-161-8/+5
| | | | | | | | | | | | | | Fixes <https://bugs.gnu.org/29704>. Reported by David Beswick <dlbeswick@gmail.com>. * module/srfi/srfi-18.scm (timeout->absolute-time): New procedure. (mutex-lock!): Use it in 'thread:lock-mutex' call. (mutex-unlock!): Use it. * test-suite/tests/srfi-18.test ("mutex-lock! returns false on timeout") ("mutex-lock! returns true when lock obtained within timeout") ("recursive lock waits") ("mutex unlock is false when condition times out"): Adjust cases where the 'timeout' parameter is a number so that it's a relative number.
* 'load-thunk-from-memory' reports the correct error.Ludovic Courtès2017-12-222-0/+55
| | | | | | | | | | Previously 'load-thunk-from-memory' would often throw to 'system-error' when passed an incorrect ELF file, leading to incorrect error messages. * libguile/loader.c (load_thunk_from_memory): Reset 'errno' when 'check_elf_header' returns non-NULL. * test-suite/tests/vm.test: New file. * test-suite/Makefile.am (SCM_TESTS): Add it.
* Fix 'crypt' deadlock upon error.Ludovic Courtès2017-12-221-1/+18
| | | | | | * libguile/posix.c (scm_crypt): Take 'scm_i_misc_mutex' right before calling 'crypt'. Move 'SCM_SYSERROR' call after 'scm_dynwind_end'. * test-suite/tests/posix.test ("crypt"): New test prefix.
* Support general arrays in random:hollow-sphere!Daniel Llorens2017-10-311-2/+45
| | | | | | * libguile/random.c (vector_scale_x, vector_sum_squares): Handle general rank-1 #t or 'f64 arrays. * test-suite/tests/random.test: Add tests for random:hollow-sphere!.
* Fix bitvectors and non-zero lower bound arrays in truncated-printDaniel Llorens2017-10-312-9/+104
| | | | | | | | | | | | | | * module/ice-9/arrays.scm (array-print-prefix): New private function. * libguile/arrays.c (scm_i_print_array): Reuse (array-print-prefix) from (ice-9 arrays). Make sure to release the array handle. * module/ice-9/pretty-print.scm (truncated-print): Support bitvectors. Don't try to guess the array prefix but call array-print-prefix from (ice-9 arrays) instead. Fix call to print-sequence to support non-zero lower bound arrays. * test-suite/tests/arrays.test: Test that arrays print properly. * test-suite/tests/print.test: Test truncated-print with bitvectors, non-zero lower bound arrays.
* Support non-zero lower bounds in array-slice-for-eachDaniel Llorens2017-10-311-0/+8
| | | | | | | | | * libguile/array-handle.c (scm_array_handle_writable_elements): Fix error message. * libguile/array-map.c (scm_array_slice_for_each): Support non-zero lower bounds. Fix error messages. * test-suite/tests/array-map.test: Test scm_array_slice_for_each with non-zero lower bound argument.
* Fix sort, sort! for arrays with nonzero lower boundDaniel Llorens2017-10-311-56/+93
| | | | | | | | | | | | * module/ice-9/arrays.scm (array-copy): New function, export. * module/Makefile.am: Install (ice-9 arrays). * doc/ref/api-data.texi: Add documentation for (ice-9 arrays). * libguile/quicksort.i.c: Use signed bounds throughout. * libguile/sort.c (scm_restricted_vector_sort_x): Fix error calls. Fix calls to quicksort. * test-suite/tests/sort.test: Actually test that the sorted results match the original data. Test cases for non-zero base index arrays for sort, sort!, and stable-sort!.