summaryrefslogtreecommitdiff
path: root/test-suite/tests
Commit message (Expand)AuthorAgeFilesLines
* i18n: locale-positive-separated-by-space? should return bool, not string...* libguile/i18n.c (scm_nl_langinfo): unpack INT_P_SEP_BY_SPACE as bool * test-suite/tests/i18n.test (nl-langinfo et al.): new tests Mike Gran2017-03-201-0/+12
* i18n: add tests for locale-digit-grouping...* test-suite/tests/i18n.test ("nl-langinfo et al."): new tests Mike Gran2017-03-201-0/+20
* i18n: add tests for locale AM/PM...* test-suite/tests/i18n.test ("nl-langinfo et al."): new tests Mike Gran2017-03-201-0/+20
* i18n: rename locale-monetary-digit-grouping to locale-monetary-grouping...* module/ice-9/i18n.scm (locale-monetary-digit-grouping): renamed to locale-monetary grouping (monetary-amount->locale-string): use renamed procedure * test-suite/tests/i18n.test (%french-locale): add LC_MONETARY (%french-utf8-locale): add LC_MONETARY ("nl-langinfo et al."): tests for locale-monetary-grouping Mike Gran2017-03-201-3/+24
* Better eval+promise+gc test...* test-suite/tests/eval.test ("promises"): Increase clear pass rate on this test. Andy Wingo2017-03-141-1/+6
* Resolve unresolved alist test cases...* test-suite/tests/alist.test: Update unresolved cases to match current behavior. Bogus but stable :/ Andy Wingo2017-03-141-58/+29
* Nonlocal prompt returns cause all effects...* module/language/cps/effects-analysis.scm (expression-effects): Prompts cause &all-effects. I tried to limit this change to CSE but it was actually LICM that was borked, so better to be conservative * test-suite/tests/control.test ("escape-only continuations"): Add test. Andy Wingo2017-03-131-1/+11
* Fix bug in comparison between real and complex...This bug was introduced by 35a90592501ebde7e7ddbf2486ca9d315e317d09. * module/language/cps/specialize-numbers.scm (specialize-operations): Check that both operands are real as a condition for specialize-f64-comparison. * test-suite/tests/numbers.test: Add test. Daniel Llorens2017-03-091-0/+9
* Fix new thread-local fluids test...* test-suite/tests/fluids.test ("dynamic states"): Fix test. Andy Wingo2017-03-071-1/+1
* Add thread local fluids...* libguile/fluids.h (struct scm_dynamic_state): Add thread_local_values table. Thread locals are flushed to a separate thread-local table. The references are strong references since the table never escapes the thread. (scm_make_thread_local_fluid, scm_fluid_thread_local_p): New functions. * libguile/fluids.c (FLUID_F_THREAD_LOCAL): (SCM_I_FLUID_THREAD_LOCAL_P): New macros. (restore_dynamic_state): Add comment about precondition. (save_dynamic_state): Flush thread locals. (scm_i_fluid_print): Print thread locals nicely. (new_fluid): Add flags arg. (scm_make_fluid, scm_make_fluid_with_default, scm_make_unbound_fluid): Adapt. (scm_make_thread_local_fluid, scm_fluid_thread_local_p): New functions. (fluid_set_x): Special flushing logic for thread-locals. (fluid_ref): Special cache miss logic for thread locals. * libguile/stacks.c (scm_init_stacks): * libguile/throw.c (scm_init_throw): %stacks and %exception-handler are thread-locals. * libguile/threads.c (guilify_self_2): Init thread locals table. * test-suite/tests/fluids.test ("dynamic states"): Add test. * doc/ref/api-control.texi (Fluids and Dynamic States): Add link to Thread-Local Variables. * doc/ref/api-scheduling.texi (Thread Local Variables): Update with real thread-locals. * NEWS: Update. Andy Wingo2017-03-071-1/+7
* Check for working profiling and virtual itimers...* configure.ac (HAVE_USABLE_GETITIMER_PROF, HAVE_USABLE_GETITIMER_VIRTUAL): new tests * doc/ref/posix.texi (setitimer, getitimer): document provided? 'ITIMER_VIRTUAL and 'ITIMER_PROF * doc/ref/statprof.texi (statprof): document ITIMER_PROF requirements * libguile/scmsigs.c (scm_setitimer, scm_getitimer): document (provided? 'ITIMER_VIRTUAL) and (provided? 'ITIMER_PROF) (scm_init_scmsigs): add features ITIMER_VIRTUAL and ITIMER_PROF * test-suite/tests/asyncs.test ("prevention via sigprof"): throw when unsupported * test-suite/tests/signals.test: throw when not supported * test-suite/tests/statprof.test: throw when not supported Mike Gran2017-03-063-41/+55
* Can't recursively search DLLs with FFI on Cygwin...* doc/ref/api-foreign.text (dynamic-link): document problems with recursive DLLs. * test-suite/standalone/test-ffi (global): with Cygwin, dynamic-link C library explicitly * test-suite/standalone/test-foreign-object-scm (libc-ptr): with Cygwin, link C library explicitly * test-suite/tests/foreign.test (qsort): with Cygwin, link C library explicitly Mike Gran2017-03-051-2/+12
* Disable Turkish locale tests on Cygwin...Cygwin's support of Turkish casing rules is broken. * test-suite/tests/i18n.test (under-turkish-utf8-locale-or-unresolved): modified Mike Gran2017-03-041-2/+3
* i18n: 'number->locale-string' guesses the minimum number of decimals....This feature was removed by 4aead68cdb86ca60cc372f0cd558cadda90ddec5. * module/ice-9/i18n.scm (number-decimal-string): Rewrite the case where DIGIT-COUNT is not an integer. (number->locale-string): Always pass FRACTION-DIGITS to 'number-decimal-string'. * test-suite/tests/format.test ("~h localized number")["1234.5"] ["padding", "padchar"]: Remove decimal specifier. * test-suite/tests/i18n.test ("number->locale-string") ["fraction", * test-suite/tests/i18n.test ("format ~h")["12 345,678"]: Remove decimal specifier. Remove one decimal. * doc/ref/api-i18n.texi (Number Input and Output): Update 'number->locale-string' doc to mention the number of decimals. Ludovic Courtès2017-03-012-11/+11
* i18n: Fix corner cases for monetary and number string conversions....Fixes <http://bugs.gnu.org/24990>. Reported by Martin Michel <dev@famic.de>. * module/ice-9/i18n.scm (integer->string, number-decimal-string): New procedures. (monetary-amount->locale-string): Use them instead of 'number->string' followed by 'string-split'. (number->locale-string): Likewise. * test-suite/tests/i18n.test ("number->locale-string")["fraction"]: Add second argument to 'number->locale-string'. ["fraction, 1 digit"]: Round up. ["fraction, 10 digits", "trailing zeros", "negative integer"]: New tests. * test-suite/tests/i18n.test ("format ~h"): Pass the number of decimals for ~h. ("monetary-amount->locale-string")["French"]: Always expect two decimals after the comma. ["one cent", "very little money"]: New tests. * test-suite/tests/format.test ("~h localized number")["1234.5"]: Specify the number of decimals explicitly. ["padding"]: Expect zero decimals. ["padchar"]: Ask for one decimal. ["decimals", "locale"]: Adjust rounding. Ludovic Courtès2017-03-012-16/+45
* tests: Choose a more plausible US English locale name....* test-suite/tests/i18n.test (%american-english-locale-name): Change to en_US.utf8". Ludovic Courtès2017-03-011-1/+1
* tests: Use 'pass-if-equal' for (ice-9 i18n) tests....* test-suite/tests/i18n.test ("number->locale-string") ("format ~h", "monetary-amount->locale-string"): Use 'pass-if-equal' instead of 'pass-if'. Ludovic Courtès2017-03-011-34/+40
* i18n: Do not represent zero as "-0"....Partly fixes <http://bugs.gnu.org/24990>. Reported by Martin Michel <dev@famic.de>. * module/ice-9/i18n.scm (monetary-amount->locale-string): Don't negate AMOUNT when it's zero. (number->locale-string): Likewise. * test-suite/tests/i18n.test ("number->locale-string")["positive inexact zero, 1 digit"]: New test. ("monetary-amount->locale-string")["positive inexact zero"]: New test. Ludovic Courtès2017-03-011-3/+14
* tests: Avoid statprof test failure on systems without 'setitimer'....Partly fixes <http://bugs.gnu.org/25463>. Reported by rennes@openmailbox.org. * test-suite/tests/statprof.test ("return values"): Wrap in 'when-implemented'. Ludovic Courtès2017-03-011-11/+12
* Disable REPL server tests if no threads...* test-suite/tests/00-repl-server.test (call-with-repl-server): The REPL server needs threads so don't bother testing if we have no threads. Also, prevent SIGPIPE from killing the parent process. Andy Wingo2017-03-011-1/+7
* tests: Avoid race condition in REPL server test....Fixes <http://bugs.gnu.org/24769>. Reported by Rob Browning <rlb@defaultvalue.org>. * test-suite/tests/00-repl-server.test ("simple expression"): Add call to 'select' before 'display'. Ludovic Courtès2017-03-011-2/+8
* tests: Throw 'unresolved when the REPL server is too slow....* test-suite/tests/00-repl-server.test (call-with-repl-server): Use (usleep 100) instead of (sleep 1). Throw 'unresolved when TRIES is too high. Ludovic Courtès2017-03-011-4/+5
* tests: Add REPL server test for CVE-2016-8606....This is a followup to 08c021916dbd3a235a9f9cc33df4c418c0724e03. * test-suite/tests/00-repl-server.test: New file. * test-suite/Makefile.am (SCM_TESTS): Add it. Ludovic Courtès2017-03-011-0/+139
* tests: Use the "normalized codeset" in locale names....* test-suite/tests/i18n.test (%french-locale-name) (%french-utf8-locale-name, %turkish-utf8-locale-name) (%german-utf8-locale-name, %greek-utf8-locale-name): Use the normalized codeset for ISO-8859-1 and UTF-8. Ludovic Courtès2017-03-011-6/+6
* Fix class slot allocation since GOOPS rewrite...* module/oop/goops.scm (%compute-layout): Fix class slot layout. Before, a #:class that was an argument to #:allocation was getting interpreted as a keyword with a value. * test-suite/tests/goops.test ("#:class slot allocation"): Add test. Andy Wingo2017-03-011-0/+9
* Flush when getting string from r6rs string output port...* module/rnrs/io/ports.scm (open-string-output-port): Calling the get-string proc should flush the buffer and reset the file position. * test-suite/tests/r6rs-ports.test ("8.2.10 Output ports"): Add tests. Thanks to Freja Nordsiek for the report. Andy Wingo2017-03-011-0/+15
* String ports can be truncated...* libguile/strports.c (string_port_truncate): (scm_make_string_port_type): Support truncate-file on string ports. * test-suite/tests/ports.test ("string ports"): Add tests. Andy Wingo2017-03-011-0/+39
* Better errors for odd-length keyword args...* libguile/vm-engine.c (bind-kwargs): * libguile/vm.c (vm_error_kwargs_missing_value): * libguile/eval.c (error_missing_value) (prepare_boot_closure_env_for_apply): Adapt to mirror VM behavior. * libguile/keywords.c (scm_c_bind_keyword_arguments): Likewise. * module/ice-9/eval.scm (primitive-eval): Update to error on (foo #:kw) with a "Keyword argument has no value" instead of the horrible "odd argument list length". Also adapts to the expected args format for the keyword-argument-error exception printer in all cases. Matches 1.8 optargs behavior also. * test-suite/standalone/test-scm-c-bind-keyword-arguments.c (test_missing_value): (missing_value_error_handler): Update test. * test-suite/tests/optargs.test: Add tests. Andy Wingo2017-02-281-0/+16
* Declare module exports before loading imports...* module/ice-9/boot-9.scm (define-module*): Process module imports after module exports. Allows for an additional kind of circular module imports (see https://bugs.gnu.org/15540). * test-suite/tests/modules.test ("circular imports"): Add test. Andy Wingo2017-02-281-0/+41
* Fix multi-arity dispatch in GOOPS...* module/oop/goops.scm (multiple-arity-dispatcher): Fix dispatch for max-arity+1 when a generic is already in multiple-arity dispatch. Fixes #24454. * test-suite/tests/goops.test ("dispatch"): Add test. Andy Wingo2017-02-221-0/+11
* Fix flonum/complex type inference....* module/language/cps/types.scm (define-binary-result!): Arithmetic where one argument is a flonum may produce a complex. * test-suite/tests/compiler.test: Add test. Andy Wingo2017-02-191-0/+12
* Stringbufs immutable by default...* libguile/snarf.h (SCM_IMMUTABLE_STRINGBUF): Remove shared flag. Stringbufs are immutable by default. * libguile/strings.c: Rewrite blurb. Change to have stringbufs be immutable by default and mutable only when marked as such. Going mutable means making a private copy. (STRINGBUF_MUTABLE, STRINGBUF_F_MUTABLE): New definitions. (SET_STRINGBUF_SHARED): Remove. (scm_i_print_stringbuf): Simplify to just alias the stringbuf as-is. (substring_with_immutable_stringbuf): New helper. (scm_i_substring, scm_i_substring_read_only, scm_i_substring_copy): use new helper. (scm_i_string_ensure_mutable_x): New helper. (scm_i_substring_shared): Use scm_i_string_ensure_mutable_x. (stringbuf_write_mutex): Remove; yaaaaaaaay. (scm_i_string_start_writing): Use scm_i_string_ensure_mutable_x. No more mutex. (scm_i_string_stop_writing): Now a no-op. (scm_i_make_symbol): Use substring/copy. (scm_sys_string_dump, scm_sys_symbol_dump): Update. * libguile/strings.h (SCM_I_STRINGBUF_F_SHARED): Remove. (SCM_I_STRINGBUF_F_MUTABLE): Add. * module/system/vm/assembler.scm (link-data): Don't add shared flag any more. Existing compiled flags are harmless tho. * test-suite/tests/strings.test ("string internals"): Update. Andy Wingo2017-02-161-8/+26
* Modernize (web http) a bit...* module/web/http.scm: Modernize the Guile Scheme by using more match, when, unless, and non-tail conversion. No functional change, with the exception of fixing a bug in write-key-value-list for symbols like 100-continue that shouldn't print as #{100-continue}#. * test-suite/tests/web-http.test (pass-if-only-parse): (pass-if-reparse, pass-if-parse): Arrange to also serialize and reparse values from pass-if-parse. Apply to all existing tests except fragments where we don't expect fragments to be written out. Andy Wingo2017-02-081-5/+22
* Fix rank 0 arrays and nested arrays in truncated-print...* module/ice-9/pretty-print.scm (print): In the array case, pass #:inner? along to (print-sequence), unless we're at the last dimension of the array. Special case for 0-rank arrays, which cannot be empty and have no length. * test-suite/tests/print.test: Test some of the cases fixed by this patch. Daniel Llorens2017-02-071-1/+28
* Support arrays in truncated-print...* module/ice-9/pretty-print.scm (print): Handle general arrays. * test-suite/tests/print.test: Test truncated-print with general arrays. Daniel Llorens2017-02-071-1/+16
* Avoid stacks in dynamically-bound values...* libguile/dynstack.h: * libguile/dynstack.c (scm_dynstack_find_old_fluid_value): New function. * libguile/fluids.c (saved_dynamic_state_ref): New helper. (scm_fluid_ref): Fix docstring. (scm_fluid_ref_star): New function allowing access to previous values for a fluid. (scm_dynamic_state_ref): New internal function. * libguile/fluids.h: Add scm_fluid_ref_star and scm_dynamic_state_ref. * libguile/stacks.c (scm_stack_id): Adapt to %stacks not being a chain. * libguile/throw.c (catch, throw_without_pre_unwind): Adapt to %exception-handlers not being a chain. * module/ice-9/boot-9.scm (catch, dispatch-exception): Instead of having %exception-handlers be a chain, use fluid-ref* to access the chain that is in place at the time the exception is thrown. Prevents unintended undelimited capture of the current exception handler stack by a delimited "catch". (%start-stack): Similarly, don't be a chain. * module/system/repl/debug.scm (frame->stack-vector): * module/system/repl/error-handling.scm (call-with-error-handling): * module/ice-9/save-stack.scm (save-stack): Adapt to %stacks not being a chain. * test-suite/tests/exceptions.test ("delimited exception handlers"): Add tests. * doc/ref/api-control.texi (Fluids and Dynamic States): Add docs. Andy Wingo2017-02-071-1/+29
* Final names for new array functions...Globally rename (array-from* -> array-slice), (array-from -> array-cell-ref), (array-amend! -> array-cell-set!), (array-for-each-cell -> array-slice-for-each). Daniel Llorens2017-01-092-29/+29
* Test format ~f with width parameters...* test-suite/tests/format.test: Additional tests for ~f. Daniel Llorens2016-12-151-0/+9
* Add suspendable-continuation?...* doc/ref/api-control.texi (Prompt Primitives): Document suspendable-continuation?. * libguile/control.c (scm_suspendable_continuation_p): New procedure. (scm_init_ice_9_control): New extension procedure, defines suspendable-continuation?. (scm_init_control): Register scm_init_ice_9_control. * libguile/eval.c (eval): * libguile/throw.c (catch): * libguile/continuations.c (scm_i_make_continuation): Restore resumable prompt cookie after continuation invocation. * libguile/vm.c (scm_call_n): Arrange to set resumable_prompt_cookie during invocation of VM. * libguile/vm.h (struct scm_vm): Add resumable_prompt_cookie member. * module/ice-9/control.scm: Export suspendable-continuation?. * test-suite/tests/control.test ("suspendable-continuation?"): New test. Andy Wingo2016-12-121-0/+27
* with-dynamic-state compiler and VM support...* libguile/dynstack.h (SCM_DYNSTACK_TYPE_DYNAMIC_STATE): * libguile/dynstack.c (DYNAMIC_STATE_WORDS, DYNAMIC_STATE_STATE_BOX): (scm_dynstack_push_dynamic_state): (scm_dynstack_unwind_dynamic_state): New definitions. (scm_dynstack_unwind_1, scm_dynstack_wind_1): Add with-dynamic-state cases. * libguile/memoize.c (push_dynamic_state, pop_dynamic_state) (do_push_dynamic_state, do_pop_dynamic_state): New definitions. (memoize, scm_init_memoize): Handle push-dynamic-state and pop-dynamic-state. * libguile/vm-engine.c (push-dynamic-state, pop-dynamic-state): New opcodes. * module/ice-9/boot-9.scm (with-dynamic-state): New definition in Scheme so that the push-dynamic-state and pop-dynamic-state always run in the VM. * module/language/cps/compile-bytecode.scm (compile-function): * module/language/cps/effects-analysis.scm: * module/language/cps/types.scm: * module/language/tree-il/effects.scm (make-effects-analyzer): * module/language/tree-il/peval.scm (peval): * module/language/tree-il/primitives.scm (*interesting-primitive-names*): * module/system/vm/assembler.scm: Add support for with-dynamic-state to the compiler. * test-suite/tests/fluids.test ("dynamic states"): Add basic tests. * doc/ref/vm.texi (Dynamic Environment Instructions): Update. Andy Wingo2016-12-051-0/+77
* Remove special support for fluids in GDB interface...* module/system/base/types.scm (inferior-fluid?, inferior-fluid-number) (<inferior-fluid>): Remove. Fluids won't have numbers in the future. (cell->object): Adapt. * test-suite/tests/types.test ("opaque objects"): Update. Andy Wingo2016-11-261-5/+2
* Deprecate scm_from_contiguous_array...scm_from_contiguous_array() was undocumented, unused within Guile, and can be replaced by make-array + array-copy! without requiring contiguity and without loss of performance. * libguile/arrays.c (scm_array_contents): Do not rely on SCM_I_ARRAY_CONTP. * test-suite/tests/arrays.test: Test array-contents with 0-rank array. * libguile/arrays.h: Declare scm_i_shap2ra(), SCM_SET_ARRAY_CONTIGUOUS_FLAG, SCM_CLR_ARRAY_CONTIGUOUS_FLAG so that scm_from_contiguous_array() can keep using them. * libguile/deprecated.c (scm_from_contiguous_array): Move here from arrays.c. * libguile/deprecated.h (scm_from_contiguous_array): Deprecate. * NEWS: Add deprecation notice. Daniel Llorens2016-11-231-0/+6
* New functions (array-for-each-cell, array-for-each-cell-in-order)...* libguile/array-map.c (scm_i_array_rebase, scm_array_for_each_cell): New functions. Export scm_array_for_each_cell() as (array-for-each-cell). (array-for-each-cell-in-order): Define additional export. * libguile/array-map.h (scm_i_array_rebase, scm_array_for_each_cell): Add prototypes. * test-suite/tests/array-map.test: Renamed from test-suite/tests/ramap.test, fix module name. Add tests for (array-for-each-cell). * test-suite/Makefile.am: Apply rename array-map.test -> ramap.test. Daniel Llorens2016-11-231-2/+33
* New functions array-from, array-from*, array-amend!...* libguile/arrays.h (scm_array_from, scm_array_from_s, scm_array_amend_x): New declarations. * libguile/arrays.c (scm_array_from, scm_array_from_s, scm_array_amend_x): New functions, export as array-from, array-from*, array-amend!. * test-suite/tests/arrays.test: Tests for array-from, array-from*, array-amend!. Replace with-test-prefix/c&e with with-test-prefix where the array read syntax isn't used. Daniel Llorens2016-11-231-3/+112
* Speed up for multi-arg cases of scm_ramap functions...This patch results in a 20%-40% speedup in the > 1 argument cases of the following microbenchmarks: (define A (make-shared-array #0(1) (const '()) #e1e7)) ; 1, 2, 3 arguments. (define a 0) ,time (array-for-each (lambda (b) (set! a (+ a b))) A) (define a 0) ,time (array-for-each (lambda (b c) (set! a (+ a b c))) A A) (define a 0) ,time (array-for-each (lambda (b c d) (set! a (+ a b c d))) A A A) (define A (make-shared-array (make-array 1) (const '()) #e1e7)) (define B (make-shared-array #0(1) (const '()) #e1e7)) ; 1, 2, 3 arguments. ,time (array-map! A + B) ,time (array-map! A + B B) ,time (array-map! A + B B B) * libguile/array-map.c (scm_ramap): Note on cproc arguments. (rafill): Assume that dst's lbnd is 0. (racp): Assume that src's lbnd is 0. (ramap): Assume that ra0's lbnd is 0. When there're more than two arguments, compute the array handles before the loop. Allocate the arg list once and reuse it in the loop. (rafe): Do as in ramap(), when there's more than one argument. (AREF, ASET): Remove. Daniel Llorens2016-11-231-2/+2
* Support typed arrays in some sort functions...* libguile/sort.c (sort!, sort, restricted-vector-sort!, sorted?): Support arrays of rank 1, whatever the type. * libguile/quicksort.i.c: Fix accessors to handle typed arrays. * test-suite/tests/sort.test: Test also with typed arrays. Daniel Llorens2016-11-231-2/+30
* Avoid unneeded internal use of array handles...* libguile/arrays.c (scm_shared_array_root): Adopt uniform check order. (scm_shared_array_offset, scm_shared_array_increments): Use the array fields directly just as scm_shared_array_root does. (scm_c_array_rank): Moved from libguile/generalized-arrays.c. Don't use array handles, but follow the same type check sequence as the other array functions (shared-array-root, etc). (scm_array_rank): Moved from libguile/generalized-arrays.h. * libguile/arrays.h: Move prototypes here. * test-suite/tests/arrays.test: Tests for shared-array-offset, shared-array-increments. Daniel Llorens2016-11-231-13/+63
* Fix compilation of rank 0 typed array literals...* module/system/vm/assembler.scm (simple-uniform-vector?): array-length fails for rank 0 arrays; fix the shape condition. * test-suite/tests/arrays.test: Test reading of #0f64(x) in compilation context. Daniel Llorens2016-11-231-1/+7
* Add asyncs test...* test-suite/tests/asyncs.test: New file. Andy Wingo2016-11-191-0/+138
* Back to simple unlock-mutex...* libguile/threads.c (scm_unlock_mutex): Bind to unlock-mutex. * libguile/threads.h: Remove scm_unlock_mutex_timed. * libguile/deprecated.h: Add scm_unlock_mutex_timed. * libguile/deprecated.c (scm_unlock_mutex_timed): Deprecate. * test-suite/tests/threads.test: Update unlock-mutex tests to use wait-condition-variable if they would wait on a cond. Andy Wingo2016-11-051-9/+7