summaryrefslogtreecommitdiff
path: root/test-suite/tests
AgeCommit message (Collapse)AuthorFilesLines
2020-03-21tests: Skip web server test when thread support is missing.Ludovic Courtès1-2/+3
* test-suite/tests/web-server.test ("GET with keep-alive"): Throw 'unresolved when not (provided? 'threads).
2020-03-07Actually run '00-repl-server.test'.Ludovic Courtès1-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.
2020-03-06Fix expansion of 'error' primitive with a non-constant argument.Ludovic Courtès1-2/+36
Fixes <https://bugs.gnu.org/39509>. Reported by Klaus Stehle <klaus.stehle@uni-tuebingen.de>. * module/language/tree-il/primitives.scm (error): Remove extra "?" argument when the first argument is not a constant. * test-suite/tests/tree-il.test ("primitives")["error"]: New test prefix.
2020-03-06Add 'hash' test for keywords.Ludovic Courtès1-1/+11
This is a followup to 8b3cad618314f02ad3921fa104f17ca0f721dfcb. * test-suite/tests/hash.test ("hash")["keyword"]: New test prefix.
2020-01-29texinfo: Properly render @acronym in plain text.Ludovic Courtès1-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.
2020-01-29texinfo: Add '*line-width*' fluid to control line wrapping.Ludovic Courtès1-0/+34
* 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.
2020-01-2300-repl-server.test: don't use fixed path for socketRob Browning1-4/+17
* test-suite/tests/00-repl-server.test (make-tempdir): Add. (call-with-repl-server): Store socket in a make-tempdir dir.
2020-01-12srfi-11: Do not expose variables to later clausesTim Gesthuizen1-1/+8
The current implementation of srfi-11s let-values allows later clauses to access and modify variables bound in earlier clauses when the clause is not a proper list. * module/srfi/srfi-11.scm (let-values): Fix switched variable names. * test-suite/tests/srfi-11.test (let-values): Add test checking that the variable cannot be changed in later clauses.
2020-01-12Respect thread local fluid defaultsRob Browning1-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.
2020-01-12Fix peval bug that ignored excess argsAndy Wingo1-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.
2020-01-06New function string-replace-substring in (ice-9 string-fun)Daniel Llorens1-1/+8
By A. Wingo in https://lists.gnu.org/archive/html/guile-devel/2014-03/msg00058.html. * module/ice-9/string-fun.scm (string-replace-substring): As stated. * doc/ref/api-data.texi: Document the new function. * test-suite/tests/strings.test: Test.
2019-11-16Add R7RS xfails due to a restriction in hungry-eol-escapes (#38239)Andy Wingo1-3/+9
* test-suite/tests/r7rs.test ("https://bugs.gnu.org/38239"): Add more xfails.
2019-11-16Add R7RS xfails due to Guile's ( . 42) syntax extensionAndy Wingo1-6/+7
* test-suite/tests/r7rs.test ("https://bugs.gnu.org/38238"): Add new xfails.
2019-11-16Add R7RS xfails due to https://bugs.gnu.org/38237 (i/o exn types)Andy Wingo1-5/+9
* test-suite/tests/r7rs.test ("https://bugs.gnu.org/38237"): Add more expected failures.
2019-11-16Add R7RS XFAILs due to https://bugs.gnu.org/38236 (datum labels)Andy Wingo1-11/+18
* test-suite/tests/r7rs.test (failing-test-with-exception): New form. ("https://bugs.gnu.org/38236"): Mark a couple more xfails.
2019-11-16Add expected failure for R7RS test due to https://bugs.gnu.org/38235Andy Wingo1-1/+7
* test-suite/tests/r7rs.test (failing-test): New form. ("https://bugs.gnu.org/38235"): New failing test.
2019-11-16Add r7rs testAndy Wingo1-0/+2551
* test-suite/tests/r7rs.test: New file, based on tests from Chibi Scheme, by Alex Shinn. There are a few failing tests that a followup will fix.
2019-11-14SRFI-18 uses core exceptionsAndy Wingo1-17/+22
* module/ice-9/boot-9.scm (exception-kind, exception-args): Export. * module/ice-9/exceptions.scm (exception-kind, exception-args): Re-export. * module/srfi/srfi-18.scm: Rewrite exception support in terms of core exceptions, not SRFI-34/35. * test-suite/tests/srfi-18.test: Since Guile doesn't expose the current exception handler as such, SRFI-18 captures it using delimited continuations. This means that we can't compare the result of (current-exception-handler) with the installed handler using eq?, even though the procedures are indeed equivalent. So, instead test handler behavior.
2019-11-13Rebase throw/catch on top of raise-exception/with-exception-handlerAndy Wingo2-17/+16
* libguile/exceptions.c: * libguile/exceptions.h: New files. * libguile.h: Add exceptions.h. * libguile/Makefile.am (libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES): (DOT_X_FILES, DOT_DOC_FILES, modinclude_HEADERS): Add exceptions.c and exceptions.h. * libguile/init.c (scm_i_init_guile): Initialize exceptions. * libguile/threads.c (scm_spawn_thread): Use new names for scm_i_make_catch_handler and scm_c_make_thunk. * libguile/throw.c: Rewrite to be implemented in terms of with-exception-handler / raise-exception. * libguile/throw.h: Use data types from exceptions.h. Move scm_report_stack_overflow and scm_report_out_of_memory to exceptions.[ch]. * module/ice-9/boot-9.scm (&error, &programming-error) (&non-continuable, make-exception-from-throw, raise-exception) (with-exception-handler): New top-level definitions. (throw, catch, with-throw-handler): Rewrite in terms of with-exception-handler and raise-exception. : New top-level definitions. * module/ice-9/exceptions.scm: Adapt to re-export &error, &programming-error, &non-continuable, raise-exception, and with-exception-handler from boot-9. (make-quit-exception, guile-quit-exception-converter): New exception converters. (make-exception-from-throw): Override core binding. * test-suite/tests/eval.test ("inner trim with prompt tag"): Adapt to "with-exception-handler" being the procedure on the stack. ("outer trim with prompt tag"): Likewise. * test-suite/tests/exceptions.test (throw-test): Use pass-if-equal. * module/srfi/srfi-34.scm: Reimplement in terms of core exceptions, and make "guard" actually re-raise continuations with the original "raise" continuation.
2019-10-29Rebase R6RS records on top of core recordsAndy Wingo1-2/+9
* module/ice-9/boot-9.scm (record-type-uid): New accessor. (make-record-type): Record UID in record type properties. * module/rnrs/conditions.scm (define-condition-type): Fix invalid invocation of make-record-type. * module/rnrs/records/inspection.scm: Rewrite to use core record inspection facilities. * module/rnrs/records/procedural.scm: Rewrite to use core make-record-type. Incidentally the result is that instances of derived R6RS record types are now flat instead of nested. * test-suite/tests/r6rs-records-procedural.test ("make-record-type-descriptor"): Relax a couple condition type checks, while we redo the exception system.
2019-10-28Add support for immutable fields in core recordsAndy Wingo1-1/+31
* module/ice-9/boot-9.scm (make-record-type): Allow (mutable NAME) or (immutable NAME) as a field name, and record field mutability in a bitfield. (record-modifier): Throw an error if the field isn't mutable. * test-suite/tests/records.test ("records"): Add tests. * doc/ref/api-data.texi (Records): Update.
2019-10-27Rename final? record type flag; add support for opaque?Andy Wingo1-6/+18
* module/ice-9/boot-9.scm (record-type-extensible?): Rename from record-type-final?, with the opposite sense. (record-type-opaque?): New accessor. (make-record-type): Change #:final? to #:extensible?, with the opposite meaning. Add #:opaque? arg. * test-suite/tests/records.test ("records"): Add opaque tests; update extensible tests. * doc/ref/api-data.texi (Records): Update. * module/srfi/srfi-35.scm (&condition, make-condition-type): Update for make-record-type API change.
2019-10-27Guile `make-record-type' supports non-generative definitionAndy Wingo1-1/+23
* module/ice-9/boot-9.scm (prefab-record-types): New definition. (make-record-type): Add #:uid keyword. * test-suite/tests/records.test ("records"): Add tests. * doc/ref/api-data.texi (Records): Document #:uid
2019-10-27Change record type "flags" field to "properties"Andy Wingo1-6/+3
* module/ice-9/boot-9.scm (record-type-properties): Rename from record-type-flags. (record-type-final?): New accessor. (make-record-type): (define-record-type): * test-suite/tests/records.test ("records"): Adapt.
2019-10-23Fix one remaining use of make-record-type with string type nameAndy Wingo1-1/+1
* test-suite/tests/gc.test ("weak-values versus records"): Fix to pass a symbol.
2019-10-23Rebase srfi-35 conditions on top of make-record-typeAndy Wingo1-1/+1
* module/srfi/srfi-35.scm: Import (ice-9 match), and remove now-unused srfi-1 import. (print-condition): Print more like records, as appears to be the intention. (&condition): Define using make-record-type. Adapt all callers. Also, compound conditions are now a disjoint type, handled specially by condition-ref, condition?, and so on. * test-suite/tests/srfi-35.test (v3): Fix an error in which a subcondition was initialized without initializers for all of its fields.
2019-10-23make-record-type does more validation on the fieldsAndy Wingo1-5/+5
* module/ice-9/boot-9.scm (make-record-type): Validate that the fields are a unique list of symbols. Deprecate passing a string as a type name. * module/system/base/syntax.scm (define-record): Update to pass a symbol as a type name. * test-suite/tests/records.test (rtd-foo, rtd-fŏŏ, "records"): Adapt to make record types with symbol names.
2019-10-22Record accessors respect subtypingAndy Wingo1-2/+50
* module/ice-9/boot-9.scm (make-record-type): Don't allow subtyping of final types. (%record-type-error): Remove helper. (record-accessor, record-modifier): Use computed record type predicate, to allow for subtyping. (define-record-type): Adapt to %record-type-error going away; these types are final so no accessor adaptation is needed. * test-suite/tests/records.test: Add tests. * doc/ref/api-data.texi (Records): Update.
2019-10-22Fix deprecated 1-arg `make-module' in testsAndy Wingo1-2/+2
* test-suite/tests/modules.test ("circular imports"): Use nullary make-module.
2019-09-27Adapt ftw.test for pending test-suite changesAndy Wingo1-1/+1
* test-suite/tests/ftw.test ("file-system-fold"): Check "standalone" instead of "vm".
2019-09-12Use "G_" as the conventional alias for gettextAndy Wingo1-5/+5
Since the change in 2.2 noted in the NEWS as "Fix literal matching for module-bound literals", defining `_' makes `syntax-rules' and `match' fail to recognize `_' as the catch-all literal. This change adapts the recommendations to current practice in 2.2, as users have had to adapt to this change. * doc/ref/api-i18n.texi (Gettext Support): Update documentation. * module/language/tree-il/analyze.scm (proc-ref?, gettext?): G_ is the conventional abbreviation, not _. * test-suite/tests/tree-il.test: Adapt. * module/ice-9/command-line.scm: Use G_ instead of _.
2019-08-28Fix bug in CSE auxiliary definitionsAndy Wingo1-0/+37
* module/language/cps/cse.scm (compute-equivalent-subexpressions): When CSE sees a definition like `(cons a b)', it will also record an "auxiliary definition" for `(car x)', where x is the variable defined by the cons, whereby calling `(car x)' can reduce to `a' if there is no intervening effect that clobbers the definitions. However, when the successor of the cons is a control-flow join, then any variables defined there have multiple definitions. It's incorrect to add the aux definition in that case. * test-suite/tests/compiler.test ("cse auxiliary definitions"): New test.
2019-08-25Allow mixed local definitions and expressionsAndy Wingo1-4/+27
This change to the expander allows mixed local definitions and expressions. The expansion turns: (let () (a) (define (b) 42) (b) (b)) into: (let () (letrec* ((t0 (begin (a) (if #f #f))) (b (lambda () 42))) (b))) Which is to say, expressions that precede definitions are expanded as definitions of a temporary via (begin EXP (if #f #f)). * module/ice-9/psyntax.scm (expand-body): Allow mixed definitions and expressions. * module/ice-9/psyntax-pp.scm: Regenerate. * test-suite/tests/syntax.test: Add a couple tests and update for new error messages.
2019-08-18Fix coverage test for top-level binding optimizationAndy Wingo1-2/+6
* test-suite/tests/coverage.test ("line-execution-counts"): Fix expectations for tail-call test.
2019-08-18Skip tests that don't work under letrectificationAndy Wingo1-8/+10
* test-suite/tests/srfi-64-test.scm: Skip a couple of tests that have unspecified result due to eq? being unspecified on procedures. * module/language/tree-il/letrectify.scm (letrectify): Add a comment.
2019-08-18Add "mod" field to tree-il toplevel ref, set, defineAndy Wingo1-3/+3
Add "mod" field to <toplevel-ref>, <toplevel-set>, and <toplevel-define>, indicating the expander's idea of what the current module is when a toplevel variable is accessed or created. This will help in later optimizations. * libguile/expand.c (TOPLEVEL_REF, TOPLEVEL_SET, TOPLEVEL_DEFINE) (expand, expand_define, expand_set_x, convert_assignment): * libguile/expand.h (SCM_EXPANDED_TOPLEVEL_REF_FIELD_NAMES): (SCM_MAKE_EXPANDED_TOPLEVEL_REF, SCM_EXPANDED_TOPLEVEL_SET_FIELD_NAMES): (SCM_MAKE_EXPANDED_TOPLEVEL_SET, SCM_EXPANDED_TOPLEVEL_DEFINE_FIELD_NAMES): (SCM_MAKE_EXPANDED_TOPLEVEL_DEFINE): * module/ice-9/compile-psyntax.scm (translate-literal-syntax-objects): * module/ice-9/psyntax-pp.scm: * module/ice-9/psyntax.scm: * module/language/tree-il.scm: * module/language/tree-il.scm (parse-tree-il, make-tree-il-folder): (pre-post-order): * module/language/tree-il/analyze.scm (goops-toplevel-definition): (macro-use-before-definition-analysis, proc-ref?, format-analysis): * module/language/tree-il/compile-cps.scm (convert): * module/language/tree-il/debug.scm (verify-tree-il): * module/language/tree-il/effects.scm (make-effects-analyzer): * module/language/tree-il/fix-letrec.scm (free-variables): * module/language/tree-il/peval.scm (peval): * test-suite/tests/tree-il.test: Adapt uses.
2019-08-13Update peval tests for fix-letrecAndy Wingo1-73/+75
* module/language/tree-il/fix-letrec.scm (fix-scc): Initial binding of letrec values is unspecified, not false. * test-suite/tests/peval.test (pass-if-peval): Fix letrec before pevalling. Update tests. A couple got better, no regressions.
2019-08-02Merge from stable-2.2Andy Wingo2-4/+149
2019-08-02Merge from stable-2.2Andy Wingo1-10/+1
2019-08-02Merge from stable-2.2Andy Wingo1-1/+10
2019-08-02Merge from stable-2.2Andy Wingo1-16/+20
2019-08-02Merge from stable-2.2Andy Wingo1-3/+30
2019-08-02Merge from stable-2.2Andy Wingo1-1/+7
2019-06-30'strftime' and 'strptime' honor the locale encoding.Ludovic Courtès1-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.
2019-06-30tests: Add (web server) test.Ludovic Courtès1-0/+118
* test-suite/tests/web-server.test: New file. * test-suite/Makefile.am (SCM_TESTS): Add it.
2019-06-24Revert "web: Add support for HTTP header continuation lines."Mark H Weaver1-10/+1
Fixes <https://bugs.gnu.org/36350>. This reverts commit 73cde5ed7218a090ecee888870908af5445796f0.
2019-06-18web: Add support for HTTP header continuation lines.Mark H Weaver1-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.
2019-06-18time.test: Use 'pass-if-equal' in more tests.Mark H Weaver1-16/+20
* test-suite/tests/time.test ("strftime"): Change some uses of 'pass-if' to instead use 'pass-if-equal'.
2019-06-07Fix RTL tests for recent arity changeAndy Wingo1-19/+19
* test-suite/tests/rtl.test: Fix tests.
2019-06-04Make URI handling locale independent.Timothy Sample1-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>