summaryrefslogtreecommitdiff
path: root/test-suite
Commit message (Collapse)AuthorAgeFilesLines
...
* tests: web-server: Wait until the server is listening.Ludovic Courtès2022-03-151-1/+24
| | | | | | | | | Fixes synchronization issues observed on slow or loaded machines, where client connection attempts would fail with ECONNREFUSED: https://issues.guix.gnu.org/54348 * test-suite/tests/web-server.test ("server is listening"): New test.
* psyntax: Honor source properties for things other than syntax objects.Ludovic Courtès2022-03-071-2/+24
| | | | | | | | | | | | | | | | | Commit 54bbe0b2846c5b1aa366c91d679ba724869c8cda inadvertently led psyntax to dismiss source location info for data returned by read hash extensions, because read hash extensions return plain data with associated source properties, even when called from 'read-syntax'. This change reverts part of this commit to restore that behavior. Fixes <https://issues.guix.gnu.org/54003>. * module/ice-9/psyntax.scm (datum-sourcev): New procedure. (source-annotation): Fall back to 'datum-sourcev'. * module/ice-9/psyntax-pp.scm: Regenerate. * test-suite/tests/compiler.test ("psyntax")["syntax-source with read-hash-extend"]: New test.
* tests: Add read-syntax + syntax-source test.Ludovic Courtès2022-03-071-2/+14
| | | | | * test-suite/tests/reader.test ("read-syntax")["syntax-source"]: New test.
* Have log and log10(real nan) return real nan regardless of signDaniel Llorens2022-01-131-1/+10
| | | | | | * libguile/numbers.c (log_of_shifted_double, scm_log10): Avoid complex extension when the argument is a real nan. * test-suite/tests/numbers.test: Tests for nans of either sign.
* New function bitvector-copy (scm_bitvector_copy)Daniel Llorens2022-01-041-2/+21
| | | | | | | | * libguile/bitvectors.h: * libguile/bitvectors.c: As stated. * test-suite/tests/bitvectors.test: Tests. * doc/ref/api-data.texi: Update "Bit vectors" section. * NEWS: Update.
* New function srfi-4-vector-type-size in (srfi srfi-4 gnu)Daniel Llorens2021-12-061-0/+17
| | | | | | | | | | | | | | This patch removes the undocumented function make-srfi-4-vector from (guile). That function is still exported from (srfi srfi-4 gnu). * libguile/srfi-4.h (scm_init_srfi_4): Split into scm_bootstrap_srfi_4() and scm_init_srfi_4(), after the pattern of scm_init_bytevectors() and scm_bootstrap_bytevectors(). * libguile/init.c: Replace scm_init_srfi_4() call by scm_bootstrap_srfi_4(). * module/srfi/srfi-4.scm: Load newly defined srfi-4 extension. This provides undocumented make-srfi-4-vector. * module/srfi/srfi-4/gnu.scm: Export srfi-4-vector-type-size. * doc/ref/srfi-modules.texi: Document srfi-4-vector-type-size.
* Support C99 complex types in (system foreign)Daniel Llorens2021-11-151-1/+8
| | | | | | | | | | * libguile/foreign.h (SCM_FOREIGN_TYPE_COMPLEX_FLOAT, SCM_FOREIGN_TYPE_COMPLEX_DOUBLE): New enums. * module/system/foreign.scm (complex-float, complex-double): Export new types. (make-c-struct, parse-c-struct): Support the new types. * libguile/foreign.c (complex-float, complex-double): Define new types. (alignof, sizeof, pack, unpack): Support the new types. * test-suite/tests/foreign.test: Test.
* Limit the range of ash, round-ash count argument to INT32Daniel Llorens2021-11-051-1/+4
| | | | | | | | | | This avoids gmp aborting e.g. with (ash 1 (expt 2 37)). The new limit is such that (ash 1 (expt 30)) is accepted but (ash 1 (expt 31)) throws. Fixes https://bugs.gnu.org/48150 * libguile/numbers.c (ash, round-ash): As stated. * test-suite/tests/numbers.test: Test a case known to make gmp abort before.
* Provide xxvector-copy and xxvector-copy! for srfi-4 vectorsDaniel Llorens2021-10-211-0/+24
| | | | | | | | | | | | These use the argument conventions of vector-copy!, string-copy!, etc. and not that of bytevector-copy! (which is from r6rs). * module/srfi/srfi-4/gnu.scm: As stated. * test-suite/tests/srfi-4.test: Tests. * doc/ref/srfi-modules.texi: Documentation. * libguile/bytevectors.c (bytevector-copy!): Add overlap note to docstring. * libguile/vectors.c (vector-copy!): Reuse text for the overlap note.
* (ice-9 format): Fix scaling floats with leading zerosTimothy Sample2021-10-191-1/+7
|
* Hotfix to unify (x ...) patterns in matchAndy Wingo2021-09-302-1/+28
| | | | | | | | | | | | * module/ice-9/match.upstream.scm (match-gen-ellipsis): Instead of just binding the identifier when matching (x ...), go through match-one so that if the id is already bound, we unify instead. * test-suite/tests/match.test ("unify in list patterns"): Add test. * test-suite/tests/match.test.upstream: Add additional tests from upstream. See commit 05c546e38 in Chibi Scheme. Thanks to Alex Shinn for help here!
* Baseline compiler no longer swaps rsh/lsh when transforming ash calls.Ludovic Courtès2021-09-201-2/+11
| | | | | | | | | | | | Reported by Marius Bakke <marius@gnu.org> at <https://issues.guix.gnu.org/50696>. Previously, the baseline compiler would incorrectly emit a right shift when for, say, (ash x 2), and a left shift for (ash x -2). * module/language/tree-il/compile-bytecode.scm (canonicalize): When Y is negative, emit 'rsh', not 'lsh'. * test-suite/tests/numbers.test ("ash at -O1"): New test.
* Extend bytevector-fill! to handle a partial fillDaniel Llorens2021-08-171-0/+14
| | | | | | | | | * libguile/bytevectors.c (bytevector-fill!): As stated. (scm_bytevector_fill_x): Stub to avoid changing the C API. * doc/ref/api-data.texi: Documentation. * libguile/vectors.c (vector-fill!): Less confusing variable names. * test-suite/tests/bytevectors.test: Test partial fill cases for bytevector-fill!.
* Remove the 'simple vector' conceptDaniel Llorens2021-08-162-2/+2
| | | | | | | | | | | | | | * Deprecate scm_is_simple_vector. * libguile/vectors.c (scm_vector_elements, scm_vector_writable_elements): These functions take an array; reword to make this clear. * libguile/print.h: Remove reference to 'simple vector'. * doc/ref/api-data.texi: Remove documentation for scm_is_simple_vector. Remove references to 'simple vector'. Fix documentation for scm_vector_elements, scm_vector_writable_elements. * test-suite/tests/arrays.test: * test-suite/tests/vectors.test: Remove references to 'simple vector'.
* Extend core vector-copy to r7rs vector-copyDaniel Llorens2021-08-061-0/+9
| | | | | | | | | * libguile/vectors.h: Declare scm_vector_copy_partial. * libguile/vectors.c (scm_vector_copy_partial): As stated. (scm_vector_copy): Reuse scm_vector_copy_partial. * module/scheme/base.scm: Reuse core vector-copy. * module/srfi/srfi-43: Reuse core vector-copy. * test-suite/tests/vectors.test: Test vector-copy.
* ice-9/read: Parse #{}}# properly.Maxime Devos2021-08-021-0/+5
| | | | | | | | | | | This is a regression since Guile 3.0.2 and breaks compilation of a Guile library. * module/ice-9/read.scm (%read)[read-parenthesized]: When SAW-BRACE? is #t but CH isn't #\#, don't eat CH. * test-suite/tests/reader.test ("#{}#): Add four test cases.
* Fix crash on #nil in syntaxesRob Browning2021-07-111-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | In 3.0.7 (after 0cc799185576712d69f11fc794454f2f5447bef7 "Ensure that (syntax ()) results in ("), the use of #nil in syntax-rules expansions like this: (define-syntax foo (syntax-rules () ((_ x) (eq? #nil x)))) (foo #t) could cause a crash that looks like this: ice-9/psyntax.scm:2795:12: In procedure syntax-violation: Syntax error: unknown location: unexpected syntax in form () To fix it, add another special case (the commit mentioned above special-cased the empty list) to preserve #nil * module/ice-9/psyntax.scm (gen-syntax): Preserve #nil. * test-suite/tests/syntax.test: Test #nil in syntax expansions. Closes: 49305
* Fix bug in eq-constant? propagation in CSE if kf == ktAndy Wingo2021-05-241-63/+67
| | | | | | | | | | * module/language/cps/cse.scm (compute-out-edges): Only propagate constant to successor if successor not kf. * test-suite/tests/compiler.test ("cse auxiliary definitions"): ("closure conversion"): Refactor. ("constant propagation"): New test. Fixes #48368.
* bug#45131: [PATCH] Compile directly to target language if no joint is found.Leo Prikler2021-05-101-0/+23
| | | | | | | | | | This enables the compilation from "manually" written Tree-IL to bytecode. See also <https://bugs.gnu.org/45131>. * system/base/compile.scm (read-and-compile)[(joint #f)]<? eof-object?>: Join exps using the default joiner for to. <exp>: Compute compiler for to. * test-suite/test/compiler.test ("read-and-compile tree-il"): New test.
* 'primitive-fork' closes and recreates the current thread's 'sleep_pipe'.Ludovic Courtès2021-05-082-0/+66
| | | | | | | | | | | | Partly fixes <https://bugs.gnu.org/41948>. Previously, the child process could end up using the same 'sleep_pipe' as its parent, leading to a race condition handling signals. * libguile/posix.c (do_fork): New function. (scm_fork): Call 'do_fork' via 'scm_without_guile'. * test-suite/standalone/test-signal-fork: New test. * test-suite/standalone/Makefile.am (check_SCRIPTS, TESTS): Add it.
* analyze: 'unbound-variable' warning handles re-exported bindings.Ludovic Courtès2021-05-021-0/+13
| | | | | | | | Fixes <https://bugs.gnu.org/47031>. * module/language/tree-il/analyze.scm (make-use-before-definition-analysis) [resolve]: Add case for when NAME is re-exported by MOD. * test-suite/tests/tree-il.test ("warnings")["re-exported binding"]: New test.
* Fix tree-il effects analysis for promptsAndy Wingo2021-05-011-0/+21
| | | | | | | | | | * module/language/tree-il/effects.scm (make-effects-analyzer): The body of a prompt is an expression only for escape-only prompts, and the handler is always a lambda. Fix bug where a prompt could be incorrectly marked effect-free. * test-suite/tests/tree-il.test ("optimize"): Add test for bug 48098. Fixes bug 48098.
* Fix bug for read-syntax on ( . args)Andy Wingo2021-05-011-2/+7
| | | | | | * module/ice-9/boot-9.scm: Capture syntax?. * module/ice-9/read.scm (read-syntax): Avoid re-annotating objects. * test-suite/tests/reader.test ("read-syntax"): Add test.
* Fix syntax testAndy Wingo2021-04-291-1/+1
| | | | | * test-suite/tests/syntax.test ("expressions"): The source location alist is unordered.
* bug#48096: [3.0.6] ‘syntax-error’ exceptions include vectors instead of ↵Ludovic Courtès2021-04-291-1/+13
| | | | | | | | | | | | source location properties Hi! In 3.0.6, a slight incompatibility crept in: ‘syntax-error’ exceptions include vectors like #("example.scm" 1 2) instead of good’ol source property alists. Here is a test case that reproduces the problem:
* bug#48089: Guile 3.0.6 returns zero-indexed locations for ‘read-error’Ludovic Courtès2021-04-291-0/+12
| | | | | | | | | | | | | | | | Ludovic Courtès <ludo@gnu.org> skribis: > Guile 3.0.6 returns zero-indexed (instead of one-indexed) source code > locations for ‘read-error’. Here’s a 3.0.6/3.0.5 comparison: > > $ /gnu/store/r2nr74rwhpqg16y1lyi6l0jn3lwx4yyz-guile-3.0.6/bin/guile <(echo '(') > ice-9/read.scm:126:4: In procedure lp: > /dev/fd/63:1:0: unexpected end of input while searching for: ) > $ guile <(echo '(') > ERROR: In procedure primitive-load: > In procedure scm_i_lreadparen: /dev/fd/63:2:1: end of file Here’s a test case waiting to succeed! :-)
* Fix closure-conversion bug for SCC with all free vars prunedAndy Wingo2021-04-271-2/+33
| | | | | | | | | * module/language/cps/closure-conversion.scm (convert-one): Fix bug when getting value of SCC whose free variables have been elided. Thanks to abcdw for the report! * test-suite/tests/compiler.test ("cse auxiliary definitions"): Remove spurious newline. ("closure conversion"): New test.
* goops: Preserve all slot options in redefinable classes.David Thompson2021-03-191-1/+43
| | | | | | | * module/goops.scm (compute-slots): Fix <redefinable-class> slot transformation. * test-suite/tests/goops.test ("slot options on redefinable classes"): Add a test.
* Fix recent i18n testsAndy Wingo2021-03-161-2/+4
| | | | | * test-suite/tests/i18n.test ("text collation (French)"): Fix to actually pass locale arg.
* Fix buffer overread in string-locale<?Andy Wingo2021-03-151-0/+7
| | | | | | | | | * libguile/i18n.c (compare_strings): In all cases, convert to a null-terminated string. While we're doing that, might as well use utf-8. * test-suite/tests/i18n.test ("text collation (French)"): Add test. Thanks again to Rob Browning for the report.
* Adapt test for string-locale-ci=?Andy Wingo2021-03-151-5/+7
| | | | | * test-suite/tests/i18n.test ("text collation (French)"): Punt on collating if utf8 locale unavailable.
* Fix buffer overread in string-locale-ci=? and related functionsAndy Wingo2021-03-151-3/+7
| | | | | | | | | | | * libguile/i18n.c (u32_locale_casecoll): Take lengths of incoming strings as parameters rather than assuming "nul" termination. (compare_u32_strings_ci): Pass string lengths as computed from the Scheme strings. * test-suite/tests/i18n.test ("text collation (English)"): Add a test case. Thanks a million to Rob Browning for the report.
* On Cygwin, 'lib' DLLs use 'cyg' prefixMike Gran2021-03-131-0/+35
| | | | | | | | | | | | | When using automake and libtool to build DLLs on Cygwin, libtool will rename libXXX to cygXXX. 'load-foreign-library' should emulate libltdl behavior and search for DLLs using that convention. * module/system/foreign-library.scm (lib->cyg): new helper function (load-foreign-library): add rename-on-cygwin? option to rename libraries using Cygwin semantics * test-suite/tests/foreign.test: new test section 'lib->cyg' * doc/ref/api-foreign.text: document new rename-on-cygwin? option for load-foreign-library
* Add tests for get-bytevector-some!Andrew Whatson2021-03-121-0/+20
| | | | | * test-suite/tests/r6rs-ports.test (get-bytevector-n! [short]): add (get-bytevector-n! [long]): add
* Revert "Handle CRLF and Unicode line endings in read-line"Andy Wingo2021-03-121-41/+1
| | | | | | | | This reverts commit 0f983e3db0c43ad7c89f57ea84f792ede373ba0c. After discussing with Mike we are going to punt the read-line changes for now. Open the port in O_TEXT mode if you want to chomp the CR in CFLF sequences.
* Handle CRLF and Unicode line endings in read-lineMike Gran2021-03-111-1/+41
| | | | | | | | | * libguile/rdelim.c (scm_read_line): handle CRLF, LS and PS * module/ice-9/suspendable-ports.scm (read-line): handle CRLF, LS, and PS * module/web/http.scm (read-header-line): take advantage of CRLF in read-line (read-header): don't need to test for \return * test-suite/tests/rdelim.test: new tests for read-line CRLF, LS and PS * doc/ref/api-io.texi: update doc for read-line
* ice-9 ftw: handle non-working inodesMichael Gran2021-03-111-17/+38
| | | | | | | | | * module/ice-9/ftw.scm (visited?-proc): accept filename for string hash (file-system-fold): use string hash if ino = 0 (ftw): use new visited?-proc * test-suite/tests/ftw.test (visited?-proc valid inodes): add filenames to visited?-proc calls (visited?-proc broken inodes): new tests (%top-srcdir): canonicalize-path
* ice-9 ftw: handle missing getuid and getgidMichael Gran2021-03-111-2/+2
| | | | | | | * module/ice-9/ftw.scm (getuid-or-false, getgid-or-false): new macros (stat-dir-readable?-proc): don't overwrite arguments (ftw, nftw): use new macros * test-suite/tests/ftw.test (test-EACCES): don't presume getuid exists
* Build standalone test libraries as unversionedMike Gran2021-03-111-4/+4
| | | | | * test-suite/standalone/Makefile.am (libtest_asmobs_la_LDFLAGS): avoid version (libtest_ffi_la_LDFLAGS, libtest_extensions_la_LDFLAGS): avoid version
* Add mkstemp; undocument mkstemp!Andy Wingo2021-03-102-23/+13
| | | | | | | | | | | | | | | | * doc/ref/posix.texi (File System): Update to document mkstemp only. * libguile/filesys.c: Make a mkstemp that doesn't modify the input template. Instead the caller has to get the file name from port-filename. (scm_mkstemp): Use the new mkstemp to implement mkstemp!. Can't deprecate yet though as the replacement hasn't been there for long enough. * libguile/posix.c (scm_tempnam): Update to mention mkstemp instead. * module/system/base/compile.scm (call-with-output-file/atomic): Use mkstemp. * test-suite/tests/posix.test: * test-suite/tests/r6rs-files.test: Use mkstemp. * NEWS: Update.
* disable popen 'no duplicates' test for MinGWMichael Gran2021-03-101-1/+6
| | | | | | | | This test, which seems quite complicated to fix, causes the MinGW build to hang. Disable it for now, but, come back to it later. * test-suite/tests/popen.test (mingw?): new constant (no duplicate): disable for mingw, for now
* Fix reading #!!#Andy Wingo2021-03-071-1/+16
| | | | | * module/ice-9/read.scm (%read): Fix reading #!!#. * test-suite/tests/reader.test ("reading"): Add some test cases.
* Fix reading "#;", "'", and similar premature-EOF situationsAndy Wingo2021-03-051-1/+1
| | | | | | * module/ice-9/read.scm (%read): Adjust how subexpressions are read to error on EOF. Improve the error message. * test-suite/tests/reader.test ("#;"): Adapt expectation.
* Fix bug in new array readerDaniel Llorens2021-03-031-1/+35
| | | | | | * module/ice-9/read.scm (read-array): Return pair for dimension when len is given; single number is lbnd for list->typed-array. * test-suite/tests/arrays.test: More test cases for the reader.
* Read-in-scheme replaces boot "read" definitionAndy Wingo2021-03-033-15/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of defining a separate module, given that "read" calls are quite all over the place, we're just going to replace the boot "read" binding with read.scm. This way, we'll be able to remove support for reader options in the boot reader, as it will only ever be used for a finite set of files. * NEWS: Update. * module/Makefile.am (ice-9/boot-9.go): Depend on read.scm. (SOURCES): * am/bootstrap.am (SOURCES): Don't build a ice-9/read.go, as we include it. * module/ice-9/boot-9.scm (read-syntax): Define here, as "include" now uses it. (read-hash-procedures, read-hash-procedure, read-hash-extend): New procedures. Will replace C variants. (read, read-syntax): Include read.scm to define these. * module/ice-9/psyntax-pp.scm (include): Regenerate. * module/ice-9/psyntax.scm (include): Use read-syntax, so we get better source information. * module/ice-9/read.scm (let*-values): New local definition, to avoid loading srfi-11. (%read): Use list->typed-array instead of u8-list->bytevector. * module/language/scheme/spec.scm: Remove (ice-9 read) import; read-syntax is there in the boot environment
* Relax srfi-105 source expectationsAndy Wingo2021-03-031-2/+8
| | | | | * test-suite/tests/srfi-105.test ("curly-infix"): For { EXPR }, allow the source to be at the { rather than at EXPR.
* Invalid charset at EOF does not cause decoding errorAndy Wingo2021-03-031-1/+1
| | | | | | | | * libguile/ports.c (peek_iconv_codepoint): If the input has no bytes, there's little point in raising a decoding error here. Therefore remove the needless iconv acquisition, harmonising with suspendable-ports. * test-suite/tests/ports.test ("port-encoding"): Update test to include some input so that the exception gets raised.
* Fix another typo in routine reading arraysDaniel Llorens2021-03-021-1/+5
| | | | | * module/ice-9/read.scm: As stated. * test-suite/tests/arrays.test: Test a fixed case.
* Read Scheme via read-syntaxAndy Wingo2021-02-251-7/+13
| | | | | | * module/language/scheme/spec.scm: Use read-syntax. * test-suite/tests/dwarf.test: Adapt expected source locations. * am/bootstrap.am (SOURCES): Add ice-9/read.
* the mkdtemp tests don't clean up the directories createdMichael Gran2021-02-041-3/+3
| | | | | | | | The tests erroneously try to rmdir the template names, not the names of the directories created. * test-suite/tests/filesys.test ("mkdtemp"): clean up temp directories, and not their templates