summaryrefslogtreecommitdiff
path: root/test-suite/tests
AgeCommit message (Collapse)AuthorFilesLines
2012-03-05Merge branch 'bt/elisp'BT Templeton1-96/+40
Conflicts: am/guilec libguile/_scm.h libguile/vm-i-scheme.c module/language/elisp/compile-tree-il.scm module/language/elisp/runtime.scm module/language/elisp/runtime/macros.scm module/language/tree-il/compile-glil.scm module/language/tree-il/primitives.scm
2012-03-02hash-set! on weak tables returns the valueAndy Wingo1-1/+9
* libguile/weak-table.h: * libguile/weak-table.c (scm_weak_table_putq_x) (scm_weak_table_remq_x, scm_weak_table_clear_x) (scm_weak_table_for_each): Declare these as returning void instead of SCM. * libguile/hashtab.c (scm_hashq_set_x, scm_hashq_remove_x) (scm_hashv_set_x, scm_hashv_remove_x) (scm_hash_set_x, scm_hash_remove_x) (scm_hashx_set_x, scm_hashx_remove_x): (scm_hash_for_each): For weak tables, have the set! functions return the values, as they used to do. Have remove! functions return #f, indicating the lack of a handle. Shim around for-each to return unspecified, even though that wasn't yet a problem. * test-suite/tests/weaks.test: Add a test.
2012-03-02Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo1-12/+9
2012-03-02tweaks to -Wformat's gettext detectionAndy Wingo1-12/+9
* module/language/tree-il/analyze.scm (proc-ref?): Change to use less false-if-exception and more variable-bound?. If a variable is present in the local module but not bound, assume that it is gettext if it has the right name. This is to allow for (define _ gettext). * test-suite/tests/tree-il.test ("warnings"): Update (_ "foo") example.
2012-03-02Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo3-434/+503
There are a some failures currently: FAIL: tree-il.test: warnings: format: non-literal format string with forward declaration ERROR: srfi-18.test: current-exception-handler: current handler returned at top level - arguments: ((wrong-type-arg "car" "Wrong type argument in position ~A (expecting ~A): ~S" (1 "pair" #<unspecified>) (#<unspecified>))) ERROR: srfi-18.test: current-exception-handler: multiple levels of handler nesting - arguments: ((wrong-type-arg "car" "Wrong type argument in position ~A (expecting ~A): ~S" (1 "pair" #<unspecified>) (#<unspecified>))) ERROR: srfi-18.test: current-exception-handler: exception handler installation is thread-safe - arguments: ((wrong-type-arg "car" "Wrong type argument in position ~A (expecting ~A): ~S" (1 "pair" #<unspecified>) (#<unspecified>))) Conflicts: module/language/tree-il/peval.scm module/language/tree-il/primitives.scm test-suite/tests/tree-il.test
2012-03-02peval: inline applications of lambda to rest argsAndy Wingo1-6/+14
* module/language/tree-il/peval.scm (peval): Add optimization to hoist the inner procedure out of e.g. (lambda args (apply (lambda ...) args)) This commit restores the ability to detect escape-only prompts at compile-time. * test-suite/tests/tree-il.test: Update test for prompt with a lambda, and add a specific test for lambda application.
2012-03-02more general treatment of call-with-promptAndy Wingo1-0/+29
* module/language/tree-il/primitives.scm (*primitive-expand-table*): Don't limit the call-with-prompt to <prompt> transition to lambda expressions. Instead we can lexically bind the handler, and rely on peval to propagate a lambda expression.
2012-03-01Fix <TAG>vector-length when applied to other uniform vector typesMark H Weaver1-0/+25
* module/srfi/srfi-4.scm, module/srfi/srfi-4/gnu.scm (define-bytevector-type): Fix definition of <TAG>vector-length when applied to uniform vectors of different element sizes. Thanks to Tobias Brandt <tob.brandt@googlemail.com> for reporting this bug. * test-suite/tests/srfi-4.test: Add tests.
2012-02-27Avoid failure when `format-analysis' stumbles upon unbound variables.Ludovic Courtès1-0/+13
* module/language/tree-il/analyze.scm (proc-ref?): Wrap `variable-ref' in `false-if-exception'. * test-suite/tests/tree-il.test ("warnings")["format"]("non-literal format string with forward declaration"): New test.
2012-02-24srfi-18 test fixAndy Wingo1-433/+430
* test-suite/tests/srfi-18.test: Enclose the tests in a begin instead of an and. Before, they were not being run, for some reason I don't fully understand.
2012-02-24signal an error on multithreaded forkAndy Wingo1-2/+5
* libguile/posix.c (scm_fork): Signal an error if a `fork' is attempted after threads have been spawned. * test-suite/tests/00-socket.test: Moved here, from socket.test, so as to run before any threads are created. * test-suite/Makefile.am: Adapt.
2012-02-23Merge remote-tracking branch 'local-2.0/stable-2.0'Andy Wingo2-2/+46
Conflicts: module/language/tree-il/analyze.scm
2012-02-22add test for recent quick fixAndy Wingo1-1/+5
* test-suite/tests/web-uri.test ("string->uri"): Add test for string->uri with hosts beginning in digits.
2012-02-20Optimize Equality PrimitivesNoah Lavine1-0/+10
* module/language/tree-il/primitives.scm: add equality-primitive?, which is true for eq?, eqv?, and equal? * module/language/tree-il/peval.scm: if an equality primitive is applied to the same variable twice, fold it to #t * test-suite/tests/tree-il.test: add tests for pevaling equality primitives
2012-02-19Have `-Wformat' recognize `ngettext' calls.Ludovic Courtès1-0/+24
* module/language/tree-il/analyze.scm (gettext?): Rename to... (proc-ref?): ... this. Add `proc' and `special-name' parameters. (gettext?): Define in terms of `proc-ref?'. (ngettext?): New procedure. (const-fmt): Recognize `ngettext' calls. (format-analysis)[<down>](check-format-args]: Check constant-but-non-string 2nd argument in the (not (const-fmt ...)) case. [check-simple-format-args]: Use `const-fmt'. * test-suite/tests/tree-il.test ("warnings")["format"]("non-literal format string using ngettext", "non-literal format string using ngettext as N_"): New tests. ("simple-format")["unsupported, ngettext"]: New test.
2012-02-19Have `-Wformat' better recognize the `gettext' procedure.Ludovic Courtès1-1/+17
Fixes <http://bugs.gnu.org/10846>. Reported by Bruno Haible <bruno@clisp.org>. * module/language/tree-il/analyze.scm (gettext?): New procedure. (const-fmt): Add `env' parameter; update callers. Use `gettext?'. (format-analysis)[check-simple-format-args]: Actually support gettextized format strings. * test-suite/tests/tree-il.test ("warnings")["format"]("non-literal format string using gettext"): Use `gettext' as the procedure name. ("non-literal format string using gettext as _"): New test. ["simple-format"]("unsupported, gettext"): New test.
2012-02-17Merge remote-tracking branch 'local-2.0/stable-2.0'Andy Wingo1-6/+42
Conflicts: libguile/read.c libguile/srcprop.c module/ice-9/psyntax-pp.scm
2012-02-15remove deprecated features testAndy Wingo1-7/+1
* test-suite/tests/procprop.test ("procedure-arity"): Remove a test of deprecated features.
2012-02-15Add tests to verify that 'read' sets source properties when appropriateMark H Weaver1-6/+42
* test-suite/tests/srcprop.test (source properties): Add tests.
2012-02-11Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo3-33/+75
Conflicts: libguile/read.c test-suite/tests/tree-il.test
2012-02-08Support => within case, and improve error messages for cond and caseMark H Weaver2-26/+67
* module/ice-9/boot-9.scm (cond, case): Reimplement using syntax-case, with improved error messages and support for '=>' within 'case' as mandated by the R7RS. Add warnings for duplicate case datums and case datums that cannot be meaningfully compared using 'eqv?'. * module/system/base/message.scm (%warning-types): Add 'bad-case-datum' and 'duplicate-case-datum' warning types. * test-suite/tests/syntax.test (cond, case): Update tests to reflect improved error reporting. Add tests for '=>' within 'case'. * test-suite/tests/tree-il.test (partial evaluation): Update tests to reflect changes in how 'case' is expanded. * doc/ref/api-control.texi (Conditionals): Document '=>' within 'case'.
2012-02-08Unoptimize 'read' to return freshly allocated empty stringsMark H Weaver1-5/+7
* libguile/read.c (scm_read_string): Return a freshly allocated string every time, even for empty strings. The motivation is to allow source properties to be added to all strings. Previously, the shared global 'scm_nullstr' was returned for empty strings. Note that empty strings still share a common global 'null_stringbuf'. * test-suite/tests/srfi-13.test (substring/shared): Fix tests to reflect the fact that empty string literals are no longer guaranteed to be 'eq?' to each other.
2012-02-08Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo8-50/+152
Conflicts: GUILE-VERSION libguile/gc-malloc.c libguile/ports.c
2012-02-04i18n: Skips ~h `format' tests when digit grouping info is missing.Ludovic Courtès1-5/+13
* test-suite/tests/i18n.test ("format ~h"): Skip tests when `locale-digit-grouping' returns '().
2012-02-03fix `flet' syntaxBT Templeton1-3/+4
* module/language/elisp/compile-tree-il.scm (process-let-bindings): Remove. (parse-let-binding, parse-flet-binding): New procedures. (generate-let, generate-let*): Now takes an association list mapping symbols to values for the `bindings' argument. (compile-let, compile-let*, compile-lexical-let) (compile-lexical-let*): Parse the bindings list with `parse-let-binding'. (compile-flet): Parse the bindings list with `parse-flet-binding'.
2012-02-03elisp binding declarationsBT Templeton1-1/+10
* module/language/elisp/compile-tree-il.scm (bind-lexically?): Accept a new `decls' argument and check it for `lexical' declarations. Establish the same kind of binding whether or not a lexical binding for `sym' exists, whereas previously the presence of a lexical binding would cause newly-established bindings to be lexical bindings as well. (split-let-bindings): Remove. All callers changed. (generate-let, generate-let*, compile-lambda): Pass the declarations list to `bind-lexically?'. * test-suite/tests/elisp-compiler.test: Explicitly disable the lexical-binding mode. Add `lexical' declarations where necessary.
2012-02-03elisp lambda list parsingBT Templeton1-2/+2
* module/language/elisp/compile-tree-il.scm (split-lambda-arguments): Remove. (parse-lambda-list, make-simple-lambda): New procedures. (compile-lambda): Use `parse-lambda-list' and `make-simple-lambda'. Set empty rest arguments to the empty list instead of `#nil'. * test-suite/tests/elisp-compiler.test ("Lambda Expressions")["rest argument"]: Use Elisp `null' instead of a Scheme equality check.
2012-02-03evaluate the function position correctlyBT Templeton1-1/+1
* module/language/elisp/compile-tree-il (compile-pair): Use `function' to perform functional evaluation. Previously, if the operator of a compound form was not a symbol, the operator would be evaluated as a normal expression. This happened to work only because there is a `lambda' macro. The compiler will now signal an error if the operator is neither a function name nor a lambda expression. * test-suite/tests/elisp-compiler.test ("Lambda Expressions")["optional argument"]: Remove an erroneous use of `function' in the function position.
2012-02-03remove `flet*' elisp special formBT Templeton1-4/+1
* module/language/elisp/compile-tree-il.scm (compile-flet*): Remove. * module/language/elisp/runtime/function-slot.scm: Update module definition. * test-suite/tests/elisp-compiler.test ("Lambda Expressions")["flet and flet*"]: Remove `flet*' test.
2012-02-03remove `with-always-lexical' elisp special formBT Templeton1-24/+2
* module/language/elisp/compile-tree-il.scm: (always-lexical): Remove. All uses changed. (with-added-symbols): Remove. (compile-with-always-lexical): Remove. (process-options!): Remove support for the `#:always-lexical' option. * module/language/elisp/runtime/function-slot.scm: Update import and re-export lists. * test-suite/tests/elisp-compiler.test: Remove or update tests using `with-always-lexical'.
2012-02-03emacs-compatible lexical bindingBT Templeton1-1/+1
* module/language/elisp/bindings.scm (global?): New function. * module/language/elisp/compile-tree-il.scm (lexical-binding): New variable. (bind-lexically?): If lexical binding is enabled, bind lexically unless a special binding exists. (compile-%set-lexical-binding-mode): New function. * module/language/elisp/lexer.scm (lexical-binding-regexp): New variable. (lex): Return a `set-lexical-binding-mode!' token if a comment is found while reading the first line. * module/language/elisp/parser.scm (get-expression): Add support for `set-lexical-binding-mode!' tokens. * module/language/elisp/runtime/function-slot.scm: Import and re-export the `%set-lexical-binding-mode' special form. * test-suite/tests/elisp-compiler.test ("Let and Let*")["lambda args inside lexical-let"]: Update.
2012-02-03fix compilation of elisp forms with empty bodiesBT Templeton1-1/+15
* module/language/elisp/compile-tree-il.scm (generate-let) (generate-let*, compile-lambda, compile-with-added-symbols) (compile-progn, compile-if): Return nil if the form's body is empty. * test-suite/tests/elisp-compiler.test ("Sequencing")["empty progn"]: New test. ("Conditionals")["if with no else"]: New test. ("Let and Let*")["empty let, empty let*"]: New test. ("Lambda Expressions")["empty lambda"]: New test.
2012-02-03remove unnecessary elisp macrosBT Templeton1-42/+1
* module/language/elisp/runtime/macros.scm (when, unless, dotimes) (dolist, pop, push): Remove. (They are not special forms in Emacs.) * module/language/elisp/runtime/function-slot.scm: Update import and export lists. * test-suite/tests/elisp-compiler.test ("Conditionals")["failing when"] ["succeeding when", "failing unless", "succeeding unless"]: Remove. ("Iteration")["dotimes", "dolist"]: Remove. ("List Built-Ins")["pop", "push"]: Remove.
2012-02-03elisp test fixesBT Templeton1-3/+3
* test-suite/tests/elisp-compiler.test ("Exceptions")["catch and throw"]: Use a freshly-consed object instead of a literal object. This test previously assumed that similar literal objects are never identical, which no longer true. ("Equivalence Predifcates")["eq"]: Likewise.
2012-02-03remove unnecessary elisp subrsBT Templeton1-14/+0
* module/language/elisp/runtime/subrs.scm (copy-tree, number-sequence): Remove. (They are not subrs in Emacs.) * test-suite/tests/elisp-compiler.test ("List Built-ins")["copy-tree", "number-sequence"]: Remove.
2012-02-03`atomp' -> `atom'BT Templeton1-3/+3
* module/language/elisp/runtime/subrs.scm (atomp) Rename to... (atom): ...this. All callers changed.
2012-02-03Augment `-Wformat' analysis with support for `~:h'.Ludovic Courtès1-0/+26
* module/language/tree-il/analyze.scm (format-string-argument-count): Add support for ~h. * test-suite/tests/tree-il.test ("warnings")["format"]("~h", "~:h with locale object", "~:h without locale object"): New tests.
2012-02-03format: Add specifier ~h for localized number output.Ludovic Courtès2-4/+62
* doc/ref/misc-modules.texi (Formatted Output): Document ~h. Recommend use of ~h instead of ~:d. * module/ice-9/format.scm (format): Add support for ~h. * test-suite/tests/format.test ("~h localized number"): New test prefix. * test-suite/tests/i18n.test (%american-english-locale-name, %american-english-locale): New variables. (under-american-english-locale-or-unresolved): New procedure. ("format ~h"): New test prefix.
2012-02-03i18n: Add a couple of tests for `monetary-amount->locale-string'.Ludovic Courtès1-0/+18
* test-suite/tests/i18n.test ("monetary-amount->locale-string"): New test prefix.
2012-02-03tests: Have `getaddrinfo' test work for Darwin 8.Ludovic Courtès1-3/+7
* doc/ref/posix.texi (Network Databases): Update description of `EAI_NODATA' to mention that Darwin provides it. * libguile/net_db.c (scm_getaddrinfo): Likewise. * test-suite/tests/net-db.test ("getaddrinfo")["wrong service name"]: Accept `EAI_NODATA' too. Reported by David Fang <fang@csl.cornell.edu>, see <http://bugs.gnu.org/10684>.
2012-02-03tests: Work around erroneous tr_TR locale in Darwin 8.Ludovic Courtès1-4/+5
* test-suite/tests/i18n.test (under-turkish-utf8-locale-or-unresolved): Add exception for Darwin 8. Reported by David Fang <fang@csl.cornell.edu>, see <http://bugs.gnu.org/10684>.
2012-02-02Update srfi-14 test for Unicode 6.1Mike Gran1-2/+2
Some Latin-1 symbols have been reclassified as punctuation * test-suite/tests/srfi-14.test: updated
2012-02-02leniency in the "unused modules are removed" gc.testAndy Wingo1-5/+16
* libguile/foreign.h: Remove comment about the finalizer bit, as I don't think that is the case any more. * test-suite/tests/gc.test: Ignore flakiness in the gc-modules test.
2012-01-31an experiment: clearing the C stack in gc testsAndy Wingo2-31/+5
* test-suite/lib.scm (clear-stale-stack-references): New helper. * test-suite/tests/gc.test: * test-suite/tests/threads.test: Use the new helper. I removed the "unresolved" throw, as I'd like to see what the bots do with this.
2012-01-30Remove stale test file.Ludovic Courtès1-1/+3
* test-suite/tests/srfi-42.test: Delete "tmp1" at the end.
2012-01-30Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo3-45/+183
Conflicts: libguile/debug.h module/ice-9/psyntax-pp.scm module/ice-9/psyntax.scm module/language/tree-il/peval.scm module/language/tree-il/primitives.scm
2012-01-30Merge commit '3d51e57cfb0404db568a6adfde2a346d3fd9907e'Andy Wingo5-16/+61
Conflicts: libguile/foreign.c libguile/hashtab.c module/ice-9/psyntax-pp.scm module/language/tree-il/compile-glil.scm
2012-01-30Merge commit '9b0975f1dc41ddd10d81fb5b0965b9e9a54ef37a'Andy Wingo2-29/+51
Conflicts: libguile/foreign.c module/ice-9/psyntax-pp.scm module/ice-9/psyntax.scm
2012-01-30Fix primitive-eval to return #<unspecified> for definitionsMark H Weaver1-0/+4
* module/ice-9/eval.scm (primitive-eval): Return #<unspecified> for definitions. Previously the variable object was returned. * test-suite/tests/eval.test (evaluator): Add test. * NEWS: Add news entry.
2012-01-30Fix 'local-eval' when the specified environment is a moduleMark H Weaver1-9/+11
* module/ice-9/local-eval.scm (local-wrap): Fix the (module? e) case, to reference the expression 'x' instead of the non-existent variable 'exp', as was previously done. Also use quasisyntax instead of quasiquote, so that the introduced 'lambda' is an identifier instead of a bare symbol, so that this will work in modules that have rebound 'lambda' to something else. * test-suite/tests/eval.test (local-eval): Make sure to test both 'local-eval' and 'local-compile' when the specified environment is a module.