Module: common-dylan-test-suite Synopsis: Common Dylan library test suite Author: Andy Armstrong, Eric Kidd Copyright: Original Code is Copyright (c) 1995-2004 Functional Objects, Inc. All rights reserved. License: Functional Objects Library Public License Version 1.0 Dual-license: GNU Lesser General Public License Warranty: Distributed WITHOUT WARRANTY OF ANY KIND define library-spec common-dylan () module common-extensions; module streams-protocol; module locators-protocol; module finalization; module simple-io; module simple-random; module simple-profiling; module transcendentals; module byte-vector; module machine-words; suite common-dylan-regressions; suite threads-test-suite; //---*** NOTE: Should be changed to module test suite test-stream-suite; end library-spec common-dylan; define module-spec common-extensions () // Numerics function integer-length () => (); // Unsupplied, unfound constant $unsupplied :: ; constant $unfound :: ; // Collections sealed instantiable class (); open abstract class (, ); sealed instantiable class (); open generic-function concatenate! (, #"rest") => (); function position (, , #"key", #"test", #"count") => (); function split (, , #"key", #"start", #"end", #"trim?") => (); open generic-function remove-all-keys! () => (); open generic-function difference (, , #"key", #"test") => (); function fill-table! (, ) => (
); open generic-function find-element (, , #"key", #"skip", #"failure") => (); macro-test table-definer-test; // Conditions open abstract class (); function condition-to-string () => (); open abstract class (); sealed instantiable class (); sealed instantiable class (); sealed instantiable class (); // Assertions & Debugging function debug-message (, #"rest") => (); macro-test assert-test; macro-test debug-assert-test; // Types function false-or (, #"rest") => (); function one-of (, #"rest") => (); function subclass () => (); // Ignoring function ignorable () => (); function ignore () => (); // Formatting function float-to-string () => (); function integer-to-string (, #"key", #"base") => (); function number-to-string () => (); function string-to-integer (, #"key", #"base", #"start", #"end") => (, ); function format-to-string (, #"rest") => (); // Control constructs macro-test iterate-test; // the macro iterate macro-test when-test; // the macro when (which we're discussing) // Application basics function application-name () => (); function application-filename () => (false-or()); function application-arguments () => (); function exit-application () => (); function register-application-exit-function () => (); end module-spec common-extensions; define module-spec streams-protocol () abstract class (); variable *standard-input* :: ; variable *standard-output* :: ; variable *standard-error* :: ; variable *debug-output* :: ; // Conditions open abstract class (); function stream-error-stream () => (); sealed instantiable class (); sealed instantiable class (); sealed instantiable class (); //---*** What should these two functions return? function stream-error-sequence () => (); function stream-error-count () => (); // Reading from streams open generic-function read-element (, #"key", #"on-end-of-stream") => (); open generic-function unread-element (, ) => (); open generic-function read (, , #"key", #"on-end-of-stream") => (); open generic-function read-into! (, , , #"key", #"start", #"on-end-of-stream") => (); open generic-function peek (, #"key", #"on-end-of-stream") => (); open generic-function discard-input () => (); open generic-function stream-input-available? () => (); open generic-function stream-contents (, #"key", #"clear-contents?") => (); open generic-function stream-contents-as (, , #"key", #"clear-contents?") => (); // Writing to streams open generic-function write (, , #"key", #"start", #"end") => (); open generic-function write-element (, ) => (); open generic-function force-output () => (); open generic-function synchronize-output () => (); open generic-function discard-output () => (); // Querying streams open generic-function stream-open? () => (); open generic-function stream-element-type () => (); open generic-function stream-at-end? () => (); open generic-function stream-size () => (false-or()); // Positioning streams open abstract class (); open generic-function stream-position () => (); open generic-function stream-position-setter (, ) => (); open generic-function adjust-stream-position (, , #"key", #"from") => (); end module-spec streams-protocol; define module-spec locators-protocol () // This may be merged into any other module. open abstract instantiable class (); open generic-function supports-open-locator? () => (); open generic-function open-locator () => (); open generic-function supports-list-locator? () => (); open generic-function list-locator () => (); end module-spec locators-protocol; define module-spec finalization () // As per Functional Objects documentation. end module-spec finalization; define module-spec simple-io () // Exports some or all of streams protocol? function format-out (, #"rest") => (); // ... under construction end module-spec simple-io; define module-spec simple-random () sealed instantiable class (); function random (, #"key", #"random") => (); end module-spec simple-random; define module-spec simple-profiling () sealed instantiable class (
); open generic-function start-profiling-type (, ) => (); open generic-function stop-profiling-type (, ) => (); open generic-function profiling-type-result (, , #"key", #"all-keys") => (); macro-test profiling-test; // ... anything else? end module-spec simple-profiling; define module-spec byte-vector () sealed instantiable class (); open generic function copy-bytes (, , , , ) => (); function byte-vector-fill (, , #"key", #"start", #"end") => (); function byte-vector-ref (, ) => (); function byte-vector-ref-setter (, , ) => (); end module-spec byte-vector; define module-spec machine-words () sealed instantiable class (); constant $machine-word-size :: ; constant $maximum-signed-machine-word :: ; constant $minimum-signed-machine-word :: ; constant $maximum-unsigned-machine-word :: ; constant $minimum-unsigned-machine-word :: ; function as-unsigned (, ) => (); end module-spec machine-words; define module-spec transcendentals () /// Constants constant $single-pi :: ; constant $double-pi :: ; constant $single-e :: ; constant $double-e :: ; /// The core classes /// Functions open generic-function sin() => (); open generic-function cos() => (); open generic-function tan() => (); // Returns the sine, cosine, or tangent of _x_, respectively. _x_ is // given in radians. // The floating point precision of the result is given by the precision // of _x_. The result will be a if _x_ is an integer. open generic-function asin() => (); // -1 <= y <= +1 open generic-function acos() => (); // -1 <= y <= +1 open generic-function atan() => (); // -1 <= y <= +1 open generic-function atan2(, ) => (); // -1 <= y <= +1 // Returns the arc sine or arc cosine of _y_, in radians. If _y_ is not // in the range [-1, +1], an error is signalled. // The floating point precision of the result is given by the precision // of _y_. The result will be a if _y_ is an integer. open generic-function sinh () => (); open generic-function cosh () => (); open generic-function tanh () => (); // Returns the hyperbolic sine, hyperbolic cosine, or hyperbolic tangent // of _x_, respectively. // The floating point precision of the result is given by the precision // of _x_. The result will be a if _x_ is an integer. open generic-function asinh () => (); open generic-function acosh () => (); open generic-function atanh () => (); // Returns the hyperbolic arc sine, hyperbolic arc cosine, or hyperbolic // arc tangent of _y_, respectively. // The floating point precision of the result is given by the precision // of _y_. The result will be a if _y_ is an integer. open generic-function log () => (); // x > 0 // Returns the natural logarithm of _x_ in base _e_. If _x_ <= 0, an // error is signalled. // The floating point precision of the result is given by the precision // of _x_. The result will be a if _x_ is an integer. open generic-function exp () => (); // Returns e raised to the power _x_. // The floating point precision of the result is given by the precision // of _x_. open generic-function logn (, ) => (); // x > 0, b > 1 // Returns the logarithm of _x_ in base _b_. If _b_ <= 1 or _x_ <= 0, an // error is signalled. // The floating point precision of the result is given by the precision // of _x_. The result will be a if _x_ is an integer. open generic-function \^ (, ) => (); // Returns _b_ raised to the power _x_. If _b_ is 0 and _x_ is not // positive, an error is signalled. If _b_ is negative and _x_ is not // an integer, an error is signalled. // The floating point precision of the result is given by the precision // of _b_. The result will be a if _b_ is an integer. // open // generic-function \^ (b :: , x :: ) => (y :: ); // Returns an integer result giving _b_ raised to the power _x_. If _b_ // is 0 and _x_ is not positive, an error is signalled. If _x_ is // negative, an error is signalled. open generic-function sqrt () => (); // x >= 0 // Returns the square root of _x_. If _x_ < 0, an error is signalled. // The floating point precision of the result is given by the precision // of _x_. The result will be a if _x_ is an integer. open generic-function isqrt () => (); // x >= 0 /// Constructing and initializing instances /// Equality and comparison functions /// Coercing and copying functions /// Type functions /// Other protocols // protocol transcendentals; end module-spec transcendentals;