summaryrefslogtreecommitdiff
path: root/test-suite
AgeCommit message (Collapse)AuthorFilesLines
2021-09-30Hotfix to unify (x ...) patterns in matchAndy Wingo2-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!
2021-09-20Baseline compiler no longer swaps rsh/lsh when transforming ash calls.Ludovic Courtès1-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.
2021-08-17Extend bytevector-fill! to handle a partial fillDaniel Llorens1-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!.
2021-08-16Remove the 'simple vector' conceptDaniel Llorens2-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'.
2021-08-06Extend core vector-copy to r7rs vector-copyDaniel Llorens1-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.
2021-08-02ice-9/read: Parse #{}}# properly.Maxime Devos1-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.
2021-07-11Fix crash on #nil in syntaxesRob Browning1-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
2021-05-24Fix bug in eq-constant? propagation in CSE if kf == ktAndy Wingo1-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.
2021-05-10bug#45131: [PATCH] Compile directly to target language if no joint is found.Leo Prikler1-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.
2021-05-08'primitive-fork' closes and recreates the current thread's 'sleep_pipe'.Ludovic Courtès2-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.
2021-05-02analyze: 'unbound-variable' warning handles re-exported bindings.Ludovic Courtès1-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.
2021-05-01Fix tree-il effects analysis for promptsAndy Wingo1-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.
2021-05-01Fix bug for read-syntax on ( . args)Andy Wingo1-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.
2021-04-29Fix syntax testAndy Wingo1-1/+1
* test-suite/tests/syntax.test ("expressions"): The source location alist is unordered.
2021-04-29bug#48096: [3.0.6] ‘syntax-error’ exceptions include vectors instead of ↵Ludovic Courtès1-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:
2021-04-29bug#48089: Guile 3.0.6 returns zero-indexed locations for ‘read-error’Ludovic Courtès1-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! :-)
2021-04-27Fix closure-conversion bug for SCC with all free vars prunedAndy Wingo1-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.
2021-03-19goops: Preserve all slot options in redefinable classes.David Thompson1-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.
2021-03-16Fix recent i18n testsAndy Wingo1-2/+4
* test-suite/tests/i18n.test ("text collation (French)"): Fix to actually pass locale arg.
2021-03-15Fix buffer overread in string-locale<?Andy Wingo1-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.
2021-03-15Adapt test for string-locale-ci=?Andy Wingo1-5/+7
* test-suite/tests/i18n.test ("text collation (French)"): Punt on collating if utf8 locale unavailable.
2021-03-15Fix buffer overread in string-locale-ci=? and related functionsAndy Wingo1-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.
2021-03-13On Cygwin, 'lib' DLLs use 'cyg' prefixMike Gran1-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
2021-03-12Add tests for get-bytevector-some!Andrew Whatson1-0/+20
* test-suite/tests/r6rs-ports.test (get-bytevector-n! [short]): add (get-bytevector-n! [long]): add
2021-03-12Revert "Handle CRLF and Unicode line endings in read-line"Andy Wingo1-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.
2021-03-11Handle CRLF and Unicode line endings in read-lineMike Gran1-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
2021-03-11ice-9 ftw: handle non-working inodesMichael Gran1-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
2021-03-11ice-9 ftw: handle missing getuid and getgidMichael Gran1-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
2021-03-11Build standalone test libraries as unversionedMike Gran1-4/+4
* test-suite/standalone/Makefile.am (libtest_asmobs_la_LDFLAGS): avoid version (libtest_ffi_la_LDFLAGS, libtest_extensions_la_LDFLAGS): avoid version
2021-03-10Add mkstemp; undocument mkstemp!Andy Wingo2-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.
2021-03-10disable popen 'no duplicates' test for MinGWMichael Gran1-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
2021-03-07Fix reading #!!#Andy Wingo1-1/+16
* module/ice-9/read.scm (%read): Fix reading #!!#. * test-suite/tests/reader.test ("reading"): Add some test cases.
2021-03-05Fix reading "#;", "'", and similar premature-EOF situationsAndy Wingo1-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.
2021-03-03Fix bug in new array readerDaniel Llorens1-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.
2021-03-03Read-in-scheme replaces boot "read" definitionAndy Wingo3-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
2021-03-03Relax srfi-105 source expectationsAndy Wingo1-2/+8
* test-suite/tests/srfi-105.test ("curly-infix"): For { EXPR }, allow the source to be at the { rather than at EXPR.
2021-03-03Invalid charset at EOF does not cause decoding errorAndy Wingo1-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.
2021-03-02Fix another typo in routine reading arraysDaniel Llorens1-1/+5
* module/ice-9/read.scm: As stated. * test-suite/tests/arrays.test: Test a fixed case.
2021-02-25Read Scheme via read-syntaxAndy Wingo1-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.
2021-02-04the mkdtemp tests don't clean up the directories createdMichael Gran1-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
2021-02-03Replace libltdl with raw dlopen, dlsymAndy Wingo1-19/+17
* NEWS: Update. * am/bootstrap.am (SOURCES): * module/Makefile.am (SOURCES): Add system/foreign-library.scm. * configure.ac: Replace ltdl check with -ldl check. * libguile/dynl.c: Rewrite to just expose core dlopen / dlsym / etc to a helper Scheme module. (scm_dynamic_link, scm_dynamic_pointer, scm_dynamic_function) (scm_dynamic_object_p, scm_dynamic_call): Rewrite in terms of (system foreign-library). * libguile/extensions.c (load_extension): Avoid scm_dynamic_call. * module/system/foreign-library.scm: New file. * module/oop/goops.scm (<dynamic-object>): Hackily export <foreign-library> instead of a class here. * doc/ref/api-foreign.texi (Foreign Function Interface): Rewrite to only document the new interfaces. Eventually we will deprecate dynamic-link and friends. * doc/ref/guile.texi (API Reference): Move Foreign Objects after Foreign Function Interface. Seems there should be some closer relationship but this will do for now. * doc/ref/tour.texi (Putting Extensions into Modules): * doc/ref/libguile-parallel.texi (Parallel Installations): Update for rename of Modules and Extensions to Foreign Extensions. * libguile/deprecated.h: * libguile/deprecated.c (scm_dynamic_unlink): Deprecate. * libguile/guile.c: Remove ltdl include. * test-suite/tests/foreign.test: Update tests to use new API, and update error expectations.
2021-01-23strptime test shouldn't presume that initial whitespace is ignoredMike Gran1-3/+3
As far as I can tell, ignoring initial whitespace is not required by POSIX. * test-suite/tests/time.test (strptime tests):
2021-01-23don't test crypt if not presentMike Gran1-1/+5
* test-suite/tests/posix.test (crypt): throw unsupported if crypt not presetnt
2021-01-23socket test should not throw unresolved outside of a testMike Gran1-2/+4
* test-suite/tests/00-socket.test: don't throw at top level
2021-01-23add test for setsockoptMichael Gran1-0/+11
* test-suite/tests/00-socket.test (setsockopt AF_INET): new test
2021-01-21socket test should not throw unresolved outside of a testMichael Gran1-18/+19
* test-suite/tests/00-socket.test: don't throw unresolved outside of a test
2021-01-21avoid a ports test when fcntl is not providedMichael Gran1-1/+1
* test-suite/tests/ports.test (non blocking I/O): disable test when fcntl is not provided
2021-01-21standalone tests require libgnu on DLL-based platformsMichael Gran1-13/+13
* test-suite/standalone/Makefile.am (test_conversion_LDADD): add libgnu (test_scm_to_latin1_string_LDADD): add libgnu (test_scm_values_LDADD): add libgnu (test_scm_c_bind_keyword_arguments): add libgnu (test_srfi_4_LDADD): add libgnu (libtest_extensions_la_LIBADD): add libgnu (test_with_guile_module_LDADD): add libgnu (test_scm_with_guile_LDADD): add libgnu (test_scm_spawn_thread_LDADD): add libgnu (test_pthread_create_LDADD): add libgnu (test_pthread_create_secondary_LDADD): add libgnu (test_smob_mark_LDADD): add libgnu (test_smob_mark_race_LDADD): add libgnu
2021-01-21skip version test if git-version-gen can't compute version from gitMichael Gran1-11/+13
This might occur due to a shallow git clone. * test-suite/tests/version.test: throw unsupported if version is unknown
2021-01-21test-foreign-object-c should link libgnuMichael Gran1-2/+2
For MinGW, the foreign object test requires stubs provided by libgnu * test-suite/standalone/Makefile.am (test_foreign_object_c_LDADD): add libgnu