From 9333137c2283f783d1ea493c41797e7a0a8b0d14 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sat, 25 Dec 2021 22:38:33 -0800 Subject: [PATCH] lots of tests --- src/language/expressions/evaluate.c | 15 +- src/language/expressions/generate.py | 141 +- src/language/expressions/helpers.c | 27 +- src/language/expressions/helpers.h | 6 +- src/language/expressions/operations.def | 374 +- src/language/expressions/parse.c | 26 +- tests/language/expressions/evaluate.at | 5113 ++++++++++++++++------- 7 files changed, 3884 insertions(+), 1818 deletions(-) diff --git a/src/language/expressions/evaluate.c b/src/language/expressions/evaluate.c index 9c809fac4c..09f237e0cd 100644 --- a/src/language/expressions/evaluate.c +++ b/src/language/expressions/evaluate.c @@ -192,13 +192,6 @@ cmd_debug_evaluate (struct lexer *lexer, struct dataset *dsother UNUSED) free (name); name = NULL; - if (c == NULL) - c = case_create (dict_get_proto (d)); - else - c = case_unshare_and_resize (c, dict_get_proto (d)); - - *case_data_rw (c, v) = value; - if (lex_match_id (lexer, "MISSING")) { struct missing_values mv; @@ -208,6 +201,13 @@ cmd_debug_evaluate (struct lexer *lexer, struct dataset *dsother UNUSED) mv_destroy (&mv); } + if (c == NULL) + c = case_create (dict_get_proto (d)); + else + c = case_unshare_and_resize (c, dict_get_proto (d)); + value_swap (case_data_rw (c, v), &value); + value_destroy (&value, width); + if (!lex_force_match (lexer, T_RPAREN)) goto done; } @@ -255,6 +255,7 @@ cmd_debug_evaluate (struct lexer *lexer, struct dataset *dsother UNUSED) switch (expr->type) { case OP_number: + case OP_num_vec_elem: { double d = expr_evaluate_num (expr, c, 0); if (d == SYSMIS) diff --git a/src/language/expressions/generate.py b/src/language/expressions/generate.py index d989a14e39..ffe780a3c3 100644 --- a/src/language/expressions/generate.py +++ b/src/language/expressions/generate.py @@ -72,6 +72,8 @@ def init_all_types(): # Vectors. Type.new_leaf('vector', 'const struct vector *', 'vector', 'v', 'vector'), + Type.new_any('num_vec_elem', 'double', 'number', 'n', + 'number', 'ns', 'SYSMIS'), # Types as leaves or auxiliary data. Type.new_leaf('expr_node', 'const struct expr_node *', @@ -240,7 +242,7 @@ class Op: for arg in self.args: arg_name = 'arg_%s' % arg.name if arg.idx is None: - if arg.type_.name in ['number', 'boolean']: + if arg.type_.name in ['number', 'boolean', 'integer']: sysmis_cond += ['!is_valid (%s)' % arg_name] elif arg.type_.name == 'number': a = arg_name @@ -369,7 +371,7 @@ def parse_input(): return_type = Type.parse() if return_type is None: return_type = types['number'] - if return_type.name not in ['number', 'string', 'boolean']: + if return_type.name not in ['number', 'string', 'boolean', 'num_vec_elem']: die('%s is not a valid return type' % return_type.name) if token == 'operator': @@ -673,17 +675,14 @@ class Arg: def print_header(): """Prints the output file header.""" - out_file.write("""\ -/* %s - Generated from %s by generate.py. - Do not modify! */ - -""" % (out_file_name, in_file_name)) + sys.stdout.write("""\ +/* Generated by generate.py. Do not modify! */ +""") def print_trailer(): """Prints the output file trailer.""" - out_file.write("""\ + sys.stdout.write("""\ /* Local Variables: @@ -695,7 +694,7 @@ def print_trailer(): def generate_evaluate_h(): - out_file.write('#include "helpers.h"\n\n') + sys.stdout.write('#include "helpers.h"\n\n') for op in order: if op.unimplemented: @@ -718,26 +717,34 @@ def generate_evaluate_h(): else: statements = ' return %s;\n' % op.expression - out_file.write('static inline %s\n' % op.returns.c_type) - out_file.write('eval_%s (%s)\n' % (op.opname, ', '.join(args))) - out_file.write('{\n') - out_file.write(statements) - out_file.write('}\n\n') + sys.stdout.write('static inline %s\n' % op.returns.c_type) + sys.stdout.write('eval_%s (%s)\n' % (op.opname, ', '.join(args))) + sys.stdout.write('{\n') + sys.stdout.write(statements) + sys.stdout.write('}\n\n') def generate_evaluate_inc(): for op in order: if op.unimplemented: - out_file.write('case %s:\n' % op.opname) - out_file.write(' NOT_REACHED ();\n\n') + sys.stdout.write('case %s:\n' % op.opname) + sys.stdout.write(' NOT_REACHED ();\n\n') continue decls = [] args = [] for arg in op.args: type_ = arg.type_ - c_type = type_.c_type - args += ['arg_%s' % arg.name] + if type_.c_type == 'int ': + c_type = 'double ' + if op.absorb_miss: + args += ['arg_%s == SYSMIS ? INT_MIN : arg_%s' + % (arg.name, arg.name)] + else: + args += ['arg_%s' % arg.name] + else: + c_type = type_.c_type + args += ['arg_%s' % arg.name] if arg.idx is None: decl = '%sarg_%s' % (c_type, arg.name) if type_.role == 'any': @@ -778,29 +785,29 @@ def generate_evaluate_inc(): stack = op.returns.stack - out_file.write('case %s:\n' % op.opname) + sys.stdout.write('case %s:\n' % op.opname) if decls: - out_file.write(' {\n') + sys.stdout.write(' {\n') for decl in decls: - out_file.write(' %s;\n' % decl) + sys.stdout.write(' %s;\n' % decl) if sysmis_cond is not None: miss_ret = op.returns.missing_value - out_file.write(' *%s++ = force_sysmis ? %s : %s;\n' + sys.stdout.write(' *%s++ = force_sysmis ? %s : %s;\n' % (stack, miss_ret, result)) else: - out_file.write(' *%s++ = %s;\n' % (stack, result)) - out_file.write(' }\n') + sys.stdout.write(' *%s++ = %s;\n' % (stack, result)) + sys.stdout.write(' }\n') else: - out_file.write(' *%s++ = %s;\n' % (stack, result)) - out_file.write(' break;\n\n') + sys.stdout.write(' *%s++ = %s;\n' % (stack, result)) + sys.stdout.write(' break;\n\n') def generate_operations_h(): - out_file.write('#include \n') - out_file.write('#include \n\n') + sys.stdout.write('#include \n') + sys.stdout.write('#include \n\n') - out_file.write('typedef enum') - out_file.write(' {\n') + sys.stdout.write('typedef enum') + sys.stdout.write(' {\n') atoms = [] for type_ in types.values(): if type_.role != 'auxonly': @@ -812,10 +819,10 @@ def generate_operations_h(): print_operations('operator', 'OP_function_last + 1', [o.opname for o in opers]) print_range('OP_composite', 'OP_function_first', 'OP_operator_last') - out_file.write(',\n\n') + sys.stdout.write(',\n\n') print_range('OP', 'OP_atom_first', 'OP_composite_last') - out_file.write('\n }\n') - out_file.write('operation_type, atom_type;\n') + sys.stdout.write('\n }\n') + sys.stdout.write('operation_type, atom_type;\n') print_predicate('is_operation', 'OP') for key in ('atom', 'composite', 'function', 'operator'): @@ -823,37 +830,37 @@ def generate_operations_h(): def print_operations(type_, first, names): - out_file.write(' /* %s types. */\n' % type_.title()) - out_file.write(' %s = %s,\n' % (names[0], first)) + sys.stdout.write(' /* %s types. */\n' % type_.title()) + sys.stdout.write(' %s = %s,\n' % (names[0], first)) for name in names[1:]: - out_file.write(' %s,\n' % name) + sys.stdout.write(' %s,\n' % name) print_range('OP_%s' % type_, names[0], names[-1]) - out_file.write(',\n\n') + sys.stdout.write(',\n\n') def print_range(prefix, first, last): - out_file.write(' %s_first = %s,\n' % (prefix, first)) - out_file.write(' %s_last = %s,\n' % (prefix, last)) - out_file.write(' n_%s = %s_last - %s_first + 1' + sys.stdout.write(' %s_first = %s,\n' % (prefix, first)) + sys.stdout.write(' %s_last = %s,\n' % (prefix, last)) + sys.stdout.write(' n_%s = %s_last - %s_first + 1' % (prefix, prefix, prefix)) def print_predicate(function, category): - out_file.write('\nstatic inline bool\n') - out_file.write('%s (operation_type op)\n' % function) - out_file.write('{\n') + sys.stdout.write('\nstatic inline bool\n') + sys.stdout.write('%s (operation_type op)\n' % function) + sys.stdout.write('{\n') if function != 'is_operation': - out_file.write(' assert (is_operation (op));\n') - out_file.write(' return op >= %s_first && op <= %s_last;\n' + sys.stdout.write(' assert (is_operation (op));\n') + sys.stdout.write(' return op >= %s_first && op <= %s_last;\n' % (category, category)) - out_file.write('}\n') + sys.stdout.write('}\n') def generate_optimize_inc(): for op in order: if not op.optimizable or op.unimplemented: - out_file.write('case %s:\n' % op.opname) - out_file.write(' NOT_REACHED ();\n\n') + sys.stdout.write('case %s:\n' % op.opname) + sys.stdout.write(' NOT_REACHED ();\n\n') continue decls = [] @@ -907,28 +914,28 @@ def generate_optimize_inc(): % (op.returns.c_type, miss_ret, result)] result = 'result' - out_file.write('case %s:\n' % op.opname) + sys.stdout.write('case %s:\n' % op.opname) alloc_func = 'expr_allocate_%s' % op.returns.name if decls: - out_file.write(' {\n') + sys.stdout.write(' {\n') for decl in decls: - out_file.write(' %s;\n' % decl) - out_file.write(' return %s (e, %s);\n' % (alloc_func, result)) - out_file.write(' }\n') + sys.stdout.write(' %s;\n' % decl) + sys.stdout.write(' return %s (e, %s);\n' % (alloc_func, result)) + sys.stdout.write(' }\n') else: - out_file.write(' return %s (e, %s);\n' % (alloc_func, result)) - out_file.write('\n') + sys.stdout.write(' return %s (e, %s);\n' % (alloc_func, result)) + sys.stdout.write('\n') def generate_parse_inc(): members = ['""', '""', '0', '0', '0', '{}', '0', '0'] - out_file.write('{%s},\n' % ', '.join(members)) + sys.stdout.write('{%s},\n' % ', '.join(members)) for type_ in types.values(): if type_.role != 'auxonly': members = ('"%s"' % type_.name, '"%s"' % type_.human_name, '0', 'OP_%s' % type_.name, '0', '{}', '0', '0') - out_file.write('{%s},\n' % ', '.join(members)) + sys.stdout.write('{%s},\n' % ', '.join(members)) for op in order: members = [] @@ -950,15 +957,16 @@ def generate_parse_inc(): members += ['%s' % (op.array_arg().times if op.array_arg() else 0)] - out_file.write('{%s},\n' % ', '.join(members)) + sys.stdout.write('{%s},\n' % ', '.join(members)) def usage(): print("""\ %s, for generating expression parsers and evaluators from definitions -usage: generate.py -o OUTPUT [-i INPUT] [-h] +usage: generate.py -o OUTPUT_TYPE [-i INPUT] [-h] > OUTPUT -i INPUT input file containing definitions (default: operations.def) - -o OUTPUT output file + -o OUTPUT output file type, one of: evaluate.h, evaluate.inc, + operations.h, optimize.inc, parse.inc -h display this help message """ % argv0) sys.exit(0) @@ -990,21 +998,20 @@ if __name__ == '__main__': '(use --help for help)' % argv0) in_file = open(in_file_name, 'r') - out_file = open(out_file_name, 'w') init_all_types() parse_input() print_header() - if out_file_name.endswith('evaluate.h'): + if out_file_name == 'evaluate.h': generate_evaluate_h() - elif out_file_name.endswith('evaluate.inc'): + elif out_file_name == 'evaluate.inc': generate_evaluate_inc() - elif out_file_name.endswith('operations.h'): + elif out_file_name == 'operations.h': generate_operations_h() - elif out_file_name.endswith('optimize.inc'): + elif out_file_name == 'optimize.inc': generate_optimize_inc() - elif out_file_name.endswith('parse.inc'): + elif out_file_name == 'parse.inc': generate_parse_inc() else: die('%s: unknown output type' % argv0) diff --git a/src/language/expressions/helpers.c b/src/language/expressions/helpers.c index d23e7fe82b..d7cde20f98 100644 --- a/src/language/expressions/helpers.c +++ b/src/language/expressions/helpers.c @@ -447,12 +447,9 @@ replace_string (struct expression *e, struct substring haystack, struct substring needle, struct substring replacement, - double n) + int n) { - if (!needle.length - || haystack.length < needle.length - || n <= 0 - || n == SYSMIS) + if (!needle.length || haystack.length < needle.length || n <= 0) return haystack; struct substring result = alloc_string (e, MAX_STRING); @@ -510,3 +507,23 @@ median (double *a, size_t n) : n % 2 ? a[n / 2] : (a[n / 2 - 1] + a[n / 2]) / 2.0); } + +const struct variable * +expr_index_vector (const struct expression *e, const struct expr_node *n, + const struct vector *v, double idx) +{ + if (idx >= 1 && idx <= vector_get_n_vars (v)) + return vector_get_var (v, idx - 1); + + msg_at (SE, expr_location (e, n), + _("Index outside valid range 1 to %zu, inclusive, for vector %s. " + "The value will be treated as system-missing."), + vector_get_n_vars (v), vector_get_name (v)); + if (idx == SYSMIS) + msg_at (SN, expr_location (e, n->args[0]), + _("The index is system-missing.")); + else + msg_at (SN, expr_location (e, n->args[0]), + _("The index has value %g."), idx); + return NULL; +} diff --git a/src/language/expressions/helpers.h b/src/language/expressions/helpers.h index 9c966cc15b..c9347da7b7 100644 --- a/src/language/expressions/helpers.h +++ b/src/language/expressions/helpers.h @@ -109,8 +109,12 @@ struct substring replace_string (struct expression *, struct substring haystack, struct substring needle, struct substring replacement, - double n); + int n); double median (double *, size_t n); +const struct variable *expr_index_vector (const struct expression *, + const struct expr_node *, + const struct vector *, double idx); + #endif /* expressions/helpers.h */ diff --git a/src/language/expressions/operations.def b/src/language/expressions/operations.def index e1132a5bc9..431a10ca9f 100644 --- a/src/language/expressions/operations.def +++ b/src/language/expressions/operations.def @@ -217,36 +217,38 @@ absorb_miss function NVALID (a[n]) absorb_miss boolean function RANGE (x != SYSMIS, a[n*2]) { - size_t i; - int sysmis = 0; - - for (i = 0; i < n; i++) + bool found = false; + bool valid = false; + for (size_t i = 0; i < n; i++) { double w = a[2 * i]; double y = a[2 * i + 1]; if (w != SYSMIS && y != SYSMIS) { if (w <= x && x <= y) - return 1.0; + found = true; + else if (w <= y) + valid = true; + else + return SYSMIS; } - else - sysmis = 1; } - return sysmis ? SYSMIS : 0.; + return found ? true : valid ? false : SYSMIS; } boolean function RANGE (string x, string a[n*2]) { - int i; - - for (i = 0; i < n; i++) + bool found = false; + for (size_t i = 0; i < n; i++) { struct substring *w = &a[2 * i]; struct substring *y = &a[2 * i + 1]; if (compare_string_3way (w, &x) <= 0 && compare_string_3way (&x, y) <= 0) - return 1.; + found = true; + else if (compare_string_3way (w, y) > 0) + return SYSMIS; } - return 0.; + return found; } function SD.2 (a[n]) @@ -453,84 +455,83 @@ string function CONCAT (string a[n]) function INDEX (string haystack, string needle) { - if (needle.length == 0) - return SYSMIS; - else + if (haystack.length >= needle.length) { - int limit = haystack.length - needle.length + 1; - int i; - for (i = 1; i <= limit; i++) + size_t limit = haystack.length - needle.length + 1; + for (size_t i = 1; i <= limit; i++) if (!memcmp (&haystack.string[i - 1], needle.string, needle.length)) return i; - return 0; } + return 0; } -function INDEX (string haystack, string needles, needle_len_d) +function INDEX (string haystack, string needles, integer needle_len) + expression e; + expr_node n; { - if (needle_len_d <= INT_MIN || needle_len_d >= INT_MAX - || (int) needle_len_d != needle_len_d - || needles.length == 0) - return SYSMIS; - else + if (needle_len <= 0 || needles.length % needle_len != 0) { - int needle_len = needle_len_d; - if (needle_len < 0 || needle_len > needles.length - || needles.length % needle_len != 0) - return SYSMIS; - else - { - int limit = haystack.length - needle_len + 1; - int i, j; - for (i = 1; i <= limit; i++) - for (j = 0; j < needles.length; j += needle_len) - if (!memcmp (&haystack.string[i - 1], &needles.string[j], - needle_len)) - return i; - return 0; - } + msg_at (SE, expr_location (e, n), + _("INDEX needle length argument must evenly divide the " + "length of the needles argument.")); + msg_at (SN, expr_location (e, n->args[1]), + _("The needles argument has length %zu."), needles.length); + msg_at (SN, expr_location (e, n->args[2]), + _("The needle length argument has value %d."), needle_len); + return SYSMIS; } + + if (haystack.length >= needle_len) + { + size_t limit = haystack.length - needle_len + 1; + for (size_t i = 1; i <= limit; i++) + for (size_t j = 0; j < needles.length; j += needle_len) + if (!memcmp (&haystack.string[i - 1], &needles.string[j], needle_len)) + return i; + } + + return 0; } function RINDEX (string haystack, string needle) { - if (needle.length == 0) - return SYSMIS; - else + if (haystack.length >= needle.length) { - int limit = haystack.length - needle.length + 1; - int i; - for (i = limit; i >= 1; i--) + size_t limit = haystack.length - needle.length + 1; + for (size_t i = limit; i >= 1; i--) if (!memcmp (&haystack.string[i - 1], needle.string, needle.length)) return i; - return 0; } + + return 0; } -function RINDEX (string haystack, string needles, needle_len_d) +function RINDEX (string haystack, string needles, integer needle_len) + expression e; + expr_node n; { - if (needle_len_d <= 0 || needle_len_d >= INT_MAX - || (int) needle_len_d != needle_len_d - || needles.length == 0) - return SYSMIS; - else + if (needle_len <= 0 || needles.length % needle_len != 0) { - int needle_len = needle_len_d; - if (needle_len < 0 || needle_len > needles.length - || needles.length % needle_len != 0) - return SYSMIS; - else - { - int limit = haystack.length - needle_len + 1; - int i, j; - for (i = limit; i >= 1; i--) - for (j = 0; j < needles.length; j += needle_len) - if (!memcmp (&haystack.string[i - 1], - &needles.string[j], needle_len)) - return i; - return 0; - } + msg_at (SE, expr_location (e, n), + _("RINDEX needle length argument must evenly divide the " + "length of the needles argument.")); + msg_at (SN, expr_location (e, n->args[1]), + _("The needles argument has length %zu."), needles.length); + msg_at (SN, expr_location (e, n->args[2]), + _("The needle length argument has value %d."), needle_len); + return SYSMIS; + } + + if (haystack.length >= needle_len) + { + size_t limit = haystack.length - needle_len + 1; + for (size_t i = limit; i >= 1; i--) + for (size_t j = 0; j < needles.length; j += needle_len) + if (!memcmp (&haystack.string[i - 1], &needles.string[j], needle_len)) + return i; } + + return 0; } function LENGTH (string s) @@ -564,75 +565,156 @@ string function UPCASE (string s) return s; } -absorb_miss string function LPAD (string s, n) +absorb_miss string function LPAD (string s, integer n) expression e; + expr_node node; { - if (n < 0 || n > MAX_STRING || (int) n != n) - return empty_string; + if (n < 0 || n > MAX_STRING) + { + if (n != INT_MIN) + { + msg_at (SE, expr_location (e, node), + _("The length argument to LPAD must be between 0 and %d."), + MAX_STRING); + msg_at (SN, expr_location (e, node->args[1]), + _("The length argument is %d."), n); + } + + return s; + } else if (s.length >= n) return s; else { struct substring t = alloc_string (e, n); - memset (t.string, ' ', n - s.length); - memcpy (&t.string[(int) n - s.length], s.string, s.length); + size_t pad = n - s.length; + memset (t.string, ' ', pad); + memcpy (&t.string[pad], s.string, s.length); return t; } } -absorb_miss string function LPAD (string s, n, string c) +absorb_miss string function LPAD (string s, integer n, string c) expression e; + expr_node node; { - if (n < 0 || n > MAX_STRING || (int) n != n || c.length != 1) - return empty_string; + if (n < 0 || n > MAX_STRING) + { + if (n != INT_MIN) + { + msg_at (SE, expr_location (e, node), + _("The length argument to LPAD must be between 0 and %d."), + MAX_STRING); + msg_at (SN, expr_location (e, node->args[1]), + _("The length argument is %d."), n); + } + + return s; + } else if (s.length >= n) return s; + else if (c.length == 0) + { + msg_at (SE, expr_location (e, node), + _("The padding argument to LPAD must not be an empty string.")); + return s; + } else { + size_t n_pad = (n - s.length) / c.length; + if (!n_pad) + return s; + struct substring t = alloc_string (e, n); - memset (t.string, c.string[0], n - s.length); - memcpy (&t.string[(int) n - s.length], s.string, s.length); + t.length = 0; + for (size_t i = 0; i < n_pad; i++) + { + memcpy (t.string + t.length, c.string, c.length); + t.length += c.length; + } + memcpy (t.string + t.length, s.string, s.length); + t.length += s.length; return t; } } string function REPLACE (string haystack, string needle, string replacement) expression e; - = replace_string (e, haystack, needle, replacement, DBL_MAX); + = replace_string (e, haystack, needle, replacement, INT_MAX); absorb_miss string function REPLACE (string haystack, string needle, - string replacement, n) + string replacement, integer n) expression e; = replace_string (e, haystack, needle, replacement, n); -absorb_miss string function RPAD (string s, n) +absorb_miss string function RPAD (string s, integer n) expression e; + expr_node node; { - if (n < 0 || n > MAX_STRING || (int) n != n) - return empty_string; + if (n < 0 || n > MAX_STRING) + { + if (n != INT_MIN) + { + msg_at (SE, expr_location (e, node), + _("The length argument to RPAD must be between 0 and %d."), + MAX_STRING); + msg_at (SN, expr_location (e, node->args[1]), + _("The length argument is %d."), n); + } + + return s; + } else if (s.length >= n) return s; else { struct substring t = alloc_string (e, n); + size_t pad = n - s.length; memcpy (t.string, s.string, s.length); - memset (&t.string[s.length], ' ', n - s.length); + memset (t.string + s.length, ' ', pad); return t; } } -absorb_miss string function RPAD (string s, n, string c) +absorb_miss string function RPAD (string s, integer n, string c) expression e; + expr_node node; { - if (n < 0 || n > MAX_STRING || (int) n != n || c.length != 1) - return empty_string; + if (n < 0 || n > MAX_STRING) + { + if (n != INT_MIN) + { + msg_at (SE, expr_location (e, node), + _("The length argument to RPAD must be between 0 and %d."), + MAX_STRING); + msg_at (SN, expr_location (e, node->args[1]), + _("The length argument is %d."), n); + } + + return s; + } else if (s.length >= n) return s; + else if (c.length == 0) + { + msg_at (SE, expr_location (e, node), + _("The padding argument to RPAD must not be an empty string.")); + return s; + } else { + size_t n_pad = (n - s.length) / c.length; + if (!n_pad) + return s; + struct substring t = alloc_string (e, n); memcpy (t.string, s.string, s.length); - memset (&t.string[s.length], c.string[0], n - s.length); + t.length = s.length; + for (size_t i = 0; i < n_pad; i++) + { + memcpy (t.string + t.length, c.string, c.length); + t.length += c.length; + } return t; } } @@ -649,17 +731,13 @@ string function LTRIM (string s) string function LTRIM (string s, string c) { - if (c.length == 1) - { - while (s.length > 0 && s.string[0] == c.string[0]) - { - s.length--; - s.string++; - } - return s; - } - else - return empty_string; + if (c.length > 0) + while (s.length >= c.length && !memcmp (s.string, c.string, c.length)) + { + s.length -= c.length; + s.string += c.length; + } + return s; } string function RTRIM (string s) @@ -671,34 +749,30 @@ string function RTRIM (string s) string function RTRIM (string s, string c) { - if (c.length == 1) - { - while (s.length > 0 && s.string[s.length - 1] == c.string[0]) - s.length--; - return s; - } - else - return empty_string; + if (c.length > 0) + while (s.length >= c.length + && !memcmp (&s.string[s.length - c.length], c.string, c.length)) + s.length -= c.length; + return s; } function NUMBER (string s, ni_format f) expression e; expr_node n; { - union value out; - char *error; - if (s.length > f->w) s.length = f->w; - error = data_in (s, C_ENCODING, f->type, settings_get_fmt_settings (), - &out, 0, NULL); + + union value out; + char *error = data_in (s, C_ENCODING, f->type, settings_get_fmt_settings (), + &out, 0, NULL); if (error == NULL) data_in_imply_decimals (s, C_ENCODING, f->type, f->d, settings_get_fmt_settings (), &out); else { msg_at (SE, expr_location (e, n->args[0]), - _("Cannot parse `%.*s' as format %s: %s"), + _("Cannot parse \"%.*s\" as format %s: %s"), (int) s.length, s.string, fmt_name (f->type), error); free (error); } @@ -1103,33 +1177,42 @@ no_opt function VALUE (num_var v) { return case_num (c, v); } +no_opt function VALUE (num_vec_elem v) +{ + return v; +} -no_opt operator VEC_ELEM_NUM (idx) +// A numeric vector element used in a "normal" context, in which a user-missing +// value becomes system-missing. +absorb_miss no_opt operator VEC_ELEM_NUM (idx) vector v; case c; expression e; expr_node n; { - if (idx >= 1 && idx <= vector_get_n_vars (v)) - { - const struct variable *var = vector_get_var (v, (size_t) idx - 1); - double value = case_num (c, var); - return !var_is_num_missing (var, value, MV_USER) ? value : SYSMIS; - } - else + const struct variable *var = expr_index_vector (e, n, v, idx); + if (var) { - if (idx == SYSMIS) - msg_at (SE, expr_location (e, n->args[0]), - _("SYSMIS is not a valid index value for %zu-element vector " - "%s. The result will be set to SYSMIS."), - vector_get_n_vars (v), vector_get_name (v)); - else - msg_at (SE, expr_location (e, n->args[0]), - _("%g is not a valid index value for %zu-element vector %s. " - "The result will be set to SYSMIS."), - idx, vector_get_n_vars (v), vector_get_name (v)); - return SYSMIS; + double d = case_num (c, var); + if (!var_is_num_missing (var, d, MV_USER)) + return d; } + return SYSMIS; +} + +// A numeric vector element used as the argument to the VALUE() function, in +// which a user-missing value retains its value. +// +// All numeric vector elements are initially parsed this way. In most contexts +// they then get coerced into numbers. +absorb_miss no_opt num_vec_elem operator VEC_ELEM_NUM_RAW (idx) + vector v; + case c; + expression e; + expr_node n; +{ + const struct variable *var = expr_index_vector (e, n, v, idx); + return var ? case_num (c, var) : SYSMIS; } absorb_miss no_opt string operator VEC_ELEM_STR (idx) @@ -1138,26 +1221,11 @@ absorb_miss no_opt string operator VEC_ELEM_STR (idx) case c; expr_node n; { - if (idx >= 1 && idx <= vector_get_n_vars (v)) - { - struct variable *var = vector_get_var (v, (size_t) idx - 1); - return copy_string (e, CHAR_CAST_BUG (char *, case_str (c, var)), - var_get_width (var)); - } - else - { - if (idx == SYSMIS) - msg_at (SE, expr_location (e, n->args[0]), - _("SYSMIS is not a valid index value for %zu-element vector " - "%s. The result will be set to the empty string."), - vector_get_n_vars (v), vector_get_name (v)); - else - msg_at (SE, expr_location (e, n->args[0]), - _("%g is not a valid index value for %zu-element vector %s. " - "The result will be set to the empty string."), - idx, vector_get_n_vars (v), vector_get_name (v)); - return empty_string; - } + const struct variable *var = expr_index_vector (e, n, v, idx); + return (var + ? copy_string (e, CHAR_CAST_BUG (char *, case_str (c, var)), + var_get_width (var)) + : empty_string); } // Terminals. diff --git a/src/language/expressions/parse.c b/src/language/expressions/parse.c index da027b5e7a..24aaecf7f1 100644 --- a/src/language/expressions/parse.c +++ b/src/language/expressions/parse.c @@ -67,6 +67,15 @@ static struct expr_node *allocate_unary_variable (struct expression *, /* Public functions. */ +static struct expr_node * +parse_expr (struct lexer *lexer, struct expression *e) +{ + struct expr_node *n = parse_or (lexer, e); + if (n && n->type == OP_VEC_ELEM_NUM_RAW) + n->type = OP_VEC_ELEM_NUM; + return n; +} + /* Parses an expression of the given TYPE. If DS is nonnull then variables and vectors within it may be referenced within the expression; otherwise, the expression must not reference any variables or vectors. Returns the new @@ -77,7 +86,7 @@ expr_parse (struct lexer *lexer, struct dataset *ds, enum val_type type) assert (val_type_is_valid (type)); struct expression *e = expr_create (ds); - struct expr_node *n = parse_or (lexer, e); + struct expr_node *n = parse_expr (lexer, e); if (!n || !type_check (e, n, type)) { expr_free (e); @@ -92,7 +101,7 @@ struct expression * expr_parse_bool (struct lexer *lexer, struct dataset *ds) { struct expression *e = expr_create (ds); - struct expr_node *n = parse_or (lexer, e); + struct expr_node *n = parse_expr (lexer, e); if (!n) { expr_free (e); @@ -124,7 +133,7 @@ expr_parse_new_variable (struct lexer *lexer, struct dataset *ds, const char *new_var_name) { struct expression *e = expr_create (ds); - struct expr_node *n = parse_or (lexer, e); + struct expr_node *n = parse_expr (lexer, e); if (!n) { expr_free (e); @@ -161,7 +170,7 @@ expr_parse_any (struct lexer *lexer, struct dataset *ds, bool optimize) struct expression *e; e = expr_create (ds); - n = parse_or (lexer, e); + n = parse_expr (lexer, e); if (n == NULL) { expr_free (e); @@ -198,6 +207,7 @@ atom_type_stack (atom_type type) { case OP_number: case OP_boolean: + case OP_num_vec_elem: return &on_number_stack; case OP_string: @@ -440,6 +450,12 @@ type_coercion__ (struct expression *e, struct expr_node *node, size_t arg_idx, *argp = expr_allocate_unary (e, OP_BOOLEAN_TO_NUM, arg); return true; } + else if (actual_type == OP_num_vec_elem) + { + if (do_coercion) + arg->type = OP_VEC_ELEM_NUM; + return true; + } break; case OP_string: @@ -1027,7 +1043,7 @@ parse_vector_element (struct lexer *lexer, struct expression *e) return NULL; operation_type type = (vector_get_type (vector) == VAL_NUMERIC - ? OP_VEC_ELEM_NUM : OP_VEC_ELEM_STR); + ? OP_VEC_ELEM_NUM_RAW : OP_VEC_ELEM_STR); struct expr_node *node = expr_allocate_binary ( e, type, element, expr_allocate_vector (e, vector)); expr_add_location (lexer, e, vector_start_ofs, node); diff --git a/tests/language/expressions/evaluate.at b/tests/language/expressions/evaluate.at index cf0fdd0783..1f38517c55 100644 --- a/tests/language/expressions/evaluate.at +++ b/tests/language/expressions/evaluate.at @@ -13,49 +13,6 @@ dnl GNU General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program. If not, see . -m4_define([CHECK_EXPR_EVAL], - [AT_SETUP([expressions - $1]) - AT_KEYWORDS([expression]) - AT_DATA([evaluate.sps], - [set mxwarn 1000. -set mxerr 1000. -set epoch 1940. -m4_foreach([check], [m4_shift($@)], - [DEBUG EVALUATE NOOPT m4_argn(4, check)/[]m4_car(check). -DEBUG EVALUATE m4_argn(4, check)/[]m4_car(check). -])]) - AT_CAPTURE_FILE([evaluate.sps]) - m4_pushdef([i], [3]) - AT_CHECK([pspp --testing-mode -O format=csv evaluate.sps], - [m4_if(m4_bregexp([m4_foreach([check], [m4_shift($@)], [m4_argn(3, check)])], [error:]), [-1], [0], [1])], - [stdout]) - AT_DATA([expout], [m4_foreach([check], [m4_shift($@)], - [m4_define([i], m4_incr(i))dnl -m4_if(m4_argn(3, check), [], [], [evaluate.sps:[]i[]: m4_argn(3, check) -])dnl -m4_argn(2, check) -m4_define([i], m4_incr(i))dnl -m4_if(m4_argn(3, check), [], [], [evaluate.sps:[]i[]: m4_argn(3, check) -])dnl -m4_argn(2, check) -])]) - AT_CHECK([[sed ' -# Transform "file:line.column:" into plain "file:line:", -# because column numbers change between opt and noopt versions. -s/\(evaluate.sps:[0-9]\{1,\}\)\.[0-9]\{1,\}:/\1:/ - -# Remove leading or trailing quotes and un-double CSV quotes. -s/^"// -s/"$// -s/""/"/g -# " - -# Delete blank lines -/^$/d' stdout]], - [0], [expout], []) - m4_popdef([i]) - AT_CLEANUP]) - AT_BANNER([expressions]) AT_SETUP([expressions - numeric syntax]) @@ -1554,7 +1511,113 @@ TAN('x') => error done AT_CLEANUP -AT_SETUP([expressions - MISSING NMISS NVALID SYSMIS ANY RANGE MAX MIN]) +AT_SETUP([expressions - vector indexing]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. + +DEBUG EVALUATE (a=11)(b=22)(c=33) VECTOR/v(1). +DEBUG EVALUATE (a=11)(b=22)(c=33) VECTOR/v(2). +DEBUG EVALUATE (a=11)(b=22)(c=33) VECTOR/v(3). +DEBUG EVALUATE (a=11)(b=22)(c=33) VECTOR/v($sysmis). +DEBUG EVALUATE (a=11)(b=22)(c=33) VECTOR/v(0). +DEBUG EVALUATE (a=11)(b=22)(c=33) VECTOR/v(4). + +DEBUG EVALUATE (a='abc')(b='def')(c='ghi') VECTOR/v(1). +DEBUG EVALUATE (a='abc')(b='def')(c='ghi') VECTOR/v(2). +DEBUG EVALUATE (a='abc')(b='def')(c='ghi') VECTOR/v(3). +DEBUG EVALUATE (a='abc')(b='def')(c='ghi') VECTOR/v($sysmis). +DEBUG EVALUATE (a='abc')(b='def')(c='ghi') VECTOR/v(0). +DEBUG EVALUATE (a='abc')(b='def')(c='ghi') VECTOR/v(4). + +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +v(1) => 11.00 + +v(2) => 22.00 + +v(3) => 33.00 + +evaluate.sps:7.42-7.51: error: DEBUG EVALUATE: Index outside valid range 1 to +3, inclusive, for vector V. The value will be treated as system-missing. + 7 | DEBUG EVALUATE (a=11)(b=22)(c=33) VECTOR/v($sysmis). + | ^~~~~~~~~~ + +evaluate.sps:7.44-7.50: note: DEBUG EVALUATE: The index is system-missing. + 7 | DEBUG EVALUATE (a=11)(b=22)(c=33) VECTOR/v($sysmis). + | ^~~~~~~ + +v($sysmis) => sysmis + +evaluate.sps:8.42-8.45: error: DEBUG EVALUATE: Index outside valid range 1 to +3, inclusive, for vector V. The value will be treated as system-missing. + 8 | DEBUG EVALUATE (a=11)(b=22)(c=33) VECTOR/v(0). + | ^~~~ + +evaluate.sps:8.44: note: DEBUG EVALUATE: The index has value 0. + 8 | DEBUG EVALUATE (a=11)(b=22)(c=33) VECTOR/v(0). + | ^ + +v(0) => sysmis + +evaluate.sps:9.42-9.45: error: DEBUG EVALUATE: Index outside valid range 1 to +3, inclusive, for vector V. The value will be treated as system-missing. + 9 | DEBUG EVALUATE (a=11)(b=22)(c=33) VECTOR/v(4). + | ^~~~ + +evaluate.sps:9.44: note: DEBUG EVALUATE: The index has value 4. + 9 | DEBUG EVALUATE (a=11)(b=22)(c=33) VECTOR/v(4). + | ^ + +v(4) => sysmis + +v(1) => "abc" + +v(2) => "def" + +v(3) => "ghi" + +evaluate.sps:14.51-14.60: error: DEBUG EVALUATE: Index outside valid range 1 to +3, inclusive, for vector V. The value will be treated as system-missing. + 14 | DEBUG EVALUATE (a='abc')(b='def')(c='ghi') VECTOR/v($sysmis). + | ^~~~~~~~~~ + +evaluate.sps:14.53-14.59: note: DEBUG EVALUATE: The index is system-missing. + 14 | DEBUG EVALUATE (a='abc')(b='def')(c='ghi') VECTOR/v($sysmis). + | ^~~~~~~ + +v($sysmis) => "" + +evaluate.sps:15.51-15.54: error: DEBUG EVALUATE: Index outside valid range 1 to +3, inclusive, for vector V. The value will be treated as system-missing. + 15 | DEBUG EVALUATE (a='abc')(b='def')(c='ghi') VECTOR/v(0). + | ^~~~ + +evaluate.sps:15.53: note: DEBUG EVALUATE: The index has value 0. + 15 | DEBUG EVALUATE (a='abc')(b='def')(c='ghi') VECTOR/v(0). + | ^ + +v(0) => "" + +evaluate.sps:16.51-16.54: error: DEBUG EVALUATE: Index outside valid range 1 to +3, inclusive, for vector V. The value will be treated as system-missing. + 16 | DEBUG EVALUATE (a='abc')(b='def')(c='ghi') VECTOR/v(4). + | ^~~~ + +evaluate.sps:16.53: note: DEBUG EVALUATE: The index has value 4. + 16 | DEBUG EVALUATE (a='abc')(b='def')(c='ghi') VECTOR/v(4). + | ^ + +v(4) => "" +]) +done +AT_CLEANUP + +AT_SETUP([expressions - MISSING NMISS NVALID SYSMIS]) AT_KEYWORDS([expression expressions evaluate]) AT_DATA([evaluate-base.sps], [ DEBUG EVALUATE SET opt. @@ -1566,10 +1629,12 @@ DEBUG EVALUATE /MISSING(' '). DEBUG EVALUATE (x=5)/x. DEBUG EVALUATE (x=5 MISSING)/x. +DEBUG EVALUATE (x=5 MISSING)/x + 1. DEBUG EVALUATE (x=SYSMIS)/x. DEBUG EVALUATE (x=5) VECTOR/v(1). DEBUG EVALUATE (x=5 MISSING) VECTOR/v(1). +DEBUG EVALUATE (x=5 MISSING) VECTOR/v(1) + 1. DEBUG EVALUATE (x=SYSMIS) VECTOR/v(1). DEBUG EVALUATE (x=5)/VALUE(x). @@ -1587,1564 +1652,3452 @@ DEBUG EVALUATE (x=SYSMIS)/MISSING(x). DEBUG EVALUATE (x=5)/SYSMIS(x). DEBUG EVALUATE (x=5 MISSING)/SYSMIS(x). DEBUG EVALUATE (x=SYSMIS)/SYSMIS(x). + +DEBUG EVALUATE /NMISS($sysmis). +DEBUG EVALUATE /NMISS(0). +DEBUG EVALUATE /NMISS($sysmis, $sysmis, $sysmis). +DEBUG EVALUATE /NMISS(1, 2, 3, 4). +DEBUG EVALUATE /NMISS(1, $sysmis, $sysmis, 2, 2, $sysmis, $sysmis, 3, 4). +DEBUG EVALUATE (a=1 MISSING) (b=2) (c=3 MISSING) (d=4)/NMISS(a, b, c, d). + +DEBUG EVALUATE /NVALID($sysmis). +DEBUG EVALUATE /NVALID(0). +DEBUG EVALUATE /NVALID($sysmis, $sysmis, $sysmis). +DEBUG EVALUATE /NVALID(1, 2, 3, 4). +DEBUG EVALUATE /NVALID(1, $sysmis, $sysmis, 2, 2, $sysmis, $sysmis, 3, 4). +DEBUG EVALUATE (a=1 MISSING) (b=2) (c=3 MISSING) (d=4)/NVALID(a, b, c, d). + +DEBUG EVALUATE /SYSMIS(1). +DEBUG EVALUATE /SYSMIS($SYSMIS). +DEBUG EVALUATE /SYSMIS(1 + $SYSMIS). ]) for opt in OPT NOOPT; do AS_BOX([$opt]) sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +MISSING(10) => false + +MISSING($SYSMIS) => true + +MISSING(ASIN(1.01)) => true + +MISSING(ASIN(.5)) => false + +evaluate.sps:7.17-7.31: error: DEBUG EVALUATE: Type mismatch invoking +MISSING(number) as MISSING(string). + 7 | DEBUG EVALUATE /MISSING(' '). + | ^~~~~~~~~~~~~~~ + +MISSING(' ') => error + +x => 5.00 + +x => sysmis + +x + 1 => sysmis + +x => sysmis + +v(1) => 5.00 + +v(1) => sysmis + +v(1) + 1 => sysmis + +v(1) => sysmis + +VALUE(x) => 5.00 + +VALUE(x) => 5.00 + +VALUE(x) => sysmis + +VALUE(v(1)) => 5.00 + +VALUE(v(1)) => 5.00 + +VALUE(v(1)) => sysmis + +MISSING(x) => false + +MISSING(x) => true + +MISSING(x) => true + +SYSMIS(x) => false + +SYSMIS(x) => false + +SYSMIS(x) => true + +NMISS($sysmis) => 1.00 + +NMISS(0) => 0.00 + +NMISS($sysmis, $sysmis, $sysmis) => 3.00 + +NMISS(1, 2, 3, 4) => 0.00 + +NMISS(1, $sysmis, $sysmis, 2, 2, $sysmis, $sysmis, 3, 4) => 4.00 + +NMISS(a, b, c, d) => 2.00 + +NVALID($sysmis) => 0.00 + +NVALID(0) => 1.00 + +NVALID($sysmis, $sysmis, $sysmis) => 0.00 + +NVALID(1, 2, 3, 4) => 4.00 + +NVALID(1, $sysmis, $sysmis, 2, 2, $sysmis, $sysmis, 3, 4) => 5.00 + +NVALID(a, b, c, d) => 2.00 + +SYSMIS(1) => false + +SYSMIS($SYSMIS) => true + +SYSMIS(1 + $SYSMIS) => true ]) done AT_CLEANUP -# FIXME: a variable name as the argument to SYSMIS is a special case -# that we don't yet test. We also can't test VALUE this way. -CHECK_EXPR_EVAL([missing nmiss nvalid sysmis any range max min], - [[missing(10)], [false]], - [[missing($sysmis)], [true]], - [[missing(asin(1.01))], [true]], - [[missing(asin(.5))], [false]], - [[missing(' ')], [error], - [error: DEBUG EVALUATE: Type mismatch invoking MISSING(number) as missing(string).]], - - [[nmiss($sysmis)], [1.00]], - [[nmiss(0)], [0.00]], - [[nmiss($sysmis, $sysmis, $sysmis)], [3.00]], - [[nmiss(1, 2, 3, 4)], [0.00]], - [[nmiss(1, $sysmis, $sysmis, 2, 2, $sysmis, $sysmis, 3, 4)], [4.00]], - - [[nvalid($sysmis)], [0.00]], - [[nvalid(0)], [1.00]], - [[nvalid($sysmis, $sysmis, $sysmis)], [0.00]], - [[nvalid(1, 2, 3, 4)], [4.00]], - [[nvalid(1, $sysmis, $sysmis, 2, 2, $sysmis, $sysmis, 3, 4)], [5.00]], - - [[sysmis(10)], [false]], - [[sysmis($sysmis)], [true]], - [[sysmis(asin(1.01))], [true]], - [[sysmis(asin(.5))], [false]], - [[sysmis(' ')], [error], - [error: DEBUG EVALUATE: Function invocation sysmis(string) does not match any known function. Candidates are: -SYSMIS(num_variable) -SYSMIS(number).]], - - [[any($sysmis, 1, $sysmis, 3)], [sysmis]], - [[any(1, 1, 2, 3)], [true]], - [[any(1, $true, 2, 3)], [true]], - [[any(1, $false, 2, 3)], [false]], - [[any(2, 1, 2, 3)], [true]], - [[any(3, 1, 2, 3)], [true]], - [[any(5, 1, 2, 3)], [false]], - [[any(1, 1, 1, 1)], [true]], - [[any($sysmis, 1, 1, 1)], [sysmis]], - [[any(1, $sysmis, $sysmis, $sysmis)], [sysmis]], - [[any($sysmis, $sysmis, $sysmis, $sysmis)], [sysmis]], - [[any(1)], [error], - [error: DEBUG EVALUATE: Function invocation any(number) does not match any known function. Candidates are: +AT_SETUP([expressions - ANY]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. + +DEBUG EVALUATE /any(1, 1, 2, 3). +DEBUG EVALUATE /any(1, $true, 2, 3). +DEBUG EVALUATE /any(1, $false, 2, 3). +DEBUG EVALUATE /any(2, 1, 2, 3). +DEBUG EVALUATE /any(3, 1, 2, 3). +DEBUG EVALUATE /any(5, 1, 2, 3). +DEBUG EVALUATE /any(1, 1, 1, 1). +DEBUG EVALUATE /any($sysmis, 1, 1, 1). +DEBUG EVALUATE /any($sysmis, 1, $sysmis, 3). +DEBUG EVALUATE /any(1, 1, $sysmis, $sysmis). +DEBUG EVALUATE /any(1, $sysmis, $sysmis, $sysmis). +DEBUG EVALUATE /any($sysmis, $sysmis, $sysmis, $sysmis). + +DEBUG EVALUATE /any(1). +DEBUG EVALUATE /any('1', 2, 3, 4). +DEBUG EVALUATE /any(1, '2', 3, 4). +DEBUG EVALUATE /any(1, 2, '3', 4). +DEBUG EVALUATE /any(1, 2, 3, '4'). + +DEBUG EVALUATE /any('', 'a', '', 'c'). +DEBUG EVALUATE /any('a', 'a', 'b', 'c'). +DEBUG EVALUATE /any('b', 'a', 'b', 'c'). +DEBUG EVALUATE /any('c', 'a', 'b', 'c'). +DEBUG EVALUATE /any('e', 'a', 'b', 'c'). +DEBUG EVALUATE /any('a', 'a', 'a', 'a'). +DEBUG EVALUATE /any('', 'a', 'a', 'a'). +DEBUG EVALUATE /any('a', '', '', ''). +DEBUG EVALUATE /any('a'). + +DEBUG EVALUATE /any('a', 'a ', 'b', 'c'). +DEBUG EVALUATE /any('b ', 'a', 'b', 'c'). +DEBUG EVALUATE /any('c ', 'a', 'b', 'c '). +DEBUG EVALUATE /any(a10, 'b', 'c', 'd'). +DEBUG EVALUATE /any('a', b, 'c', 'd'). +DEBUG EVALUATE /any('a', 'b', c, 'd'). +DEBUG EVALUATE /any('a', 'b', 'c', d). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], +[[any(1, 1, 2, 3) => true + +any(1, $true, 2, 3) => true + +any(1, $false, 2, 3) => false + +any(2, 1, 2, 3) => true + +any(3, 1, 2, 3) => true + +any(5, 1, 2, 3) => false + +any(1, 1, 1, 1) => true + +any($sysmis, 1, 1, 1) => sysmis + +any($sysmis, 1, $sysmis, 3) => sysmis + +any(1, 1, $sysmis, $sysmis) => true + +any(1, $sysmis, $sysmis, $sysmis) => sysmis + +any($sysmis, $sysmis, $sysmis, $sysmis) => sysmis + +evaluate.sps:17.17-17.22: error: DEBUG EVALUATE: Function invocation +any(number) does not match any known function. Candidates are: ANY(number, number[, number]...) -ANY(string, string[, string]...).]], - [[any('1', 2, 3, 4)], [error], - [error: DEBUG EVALUATE: Function invocation any(string, number, number, number) does not match any known function. Candidates are: +ANY(string, string[, string]...). + 17 | DEBUG EVALUATE /any(1). + | ^~~~~~ + +any(1) => error + +evaluate.sps:18.17-18.33: error: DEBUG EVALUATE: Function invocation +any(string, number, number, number) does not match any known function. +Candidates are: ANY(number, number[, number]...) -ANY(string, string[, string]...).]], - [[any(1, '2', 3, 4)], [error], - [error: DEBUG EVALUATE: Function invocation any(number, string, number, number) does not match any known function. Candidates are: +ANY(string, string[, string]...). + 18 | DEBUG EVALUATE /any('1', 2, 3, 4). + | ^~~~~~~~~~~~~~~~~ + +any('1', 2, 3, 4) => error + +evaluate.sps:19.17-19.33: error: DEBUG EVALUATE: Function invocation +any(number, string, number, number) does not match any known function. +Candidates are: ANY(number, number[, number]...) -ANY(string, string[, string]...).]], - [[any(1, 2, '3', 4)], [error], - [error: DEBUG EVALUATE: Function invocation any(number, number, string, number) does not match any known function. Candidates are: +ANY(string, string[, string]...). + 19 | DEBUG EVALUATE /any(1, '2', 3, 4). + | ^~~~~~~~~~~~~~~~~ + +any(1, '2', 3, 4) => error + +evaluate.sps:20.17-20.33: error: DEBUG EVALUATE: Function invocation +any(number, number, string, number) does not match any known function. +Candidates are: ANY(number, number[, number]...) -ANY(string, string[, string]...).]], - [[any(1, 2, 3, '4')], [error], - [error: DEBUG EVALUATE: Function invocation any(number, number, number, string) does not match any known function. Candidates are: +ANY(string, string[, string]...). + 20 | DEBUG EVALUATE /any(1, 2, '3', 4). + | ^~~~~~~~~~~~~~~~~ + +any(1, 2, '3', 4) => error + +evaluate.sps:21.17-21.33: error: DEBUG EVALUATE: Function invocation +any(number, number, number, string) does not match any known function. +Candidates are: ANY(number, number[, number]...) -ANY(string, string[, string]...).]], - - [[any('', 'a', '', 'c')], [true]], - [[any('a', 'a', 'b', 'c')], [true]], - [[any('b', 'a', 'b', 'c')], [true]], - [[any('c', 'a', 'b', 'c')], [true]], - [[any('e', 'a', 'b', 'c')], [false]], - [[any('a', 'a', 'a', 'a')], [true]], - [[any('', 'a', 'a', 'a')], [false]], - [[any('a', '', '', '')], [false]], - [[any('a')], [error], - [error: DEBUG EVALUATE: Function invocation any(string) does not match any known function. Candidates are: +ANY(string, string[, string]...). + 21 | DEBUG EVALUATE /any(1, 2, 3, '4'). + | ^~~~~~~~~~~~~~~~~ + +any(1, 2, 3, '4') => error + +any('', 'a', '', 'c') => true + +any('a', 'a', 'b', 'c') => true + +any('b', 'a', 'b', 'c') => true + +any('c', 'a', 'b', 'c') => true + +any('e', 'a', 'b', 'c') => false + +any('a', 'a', 'a', 'a') => true + +any('', 'a', 'a', 'a') => false + +any('a', '', '', '') => false + +evaluate.sps:31.17-31.24: error: DEBUG EVALUATE: Function invocation +any(string) does not match any known function. Candidates are: ANY(number, number[, number]...) -ANY(string, string[, string]...).]], - [[any('a', 'a ', 'b', 'c')], [true]], - [[any('b ', 'a', 'b', 'c')], [true]], - [[any('c ', 'a', 'b', 'c ')], [true]], - [[any(a10, 'b', 'c', 'd')], [error], - [error: DEBUG EVALUATE: Function invocation any(format, string, string, string) does not match any known function. Candidates are: +ANY(string, string[, string]...). + 31 | DEBUG EVALUATE /any('a'). + | ^~~~~~~~ + +any('a') => error + +any('a', 'a ', 'b', 'c') => true + +any('b ', 'a', 'b', 'c') => true + +any('c ', 'a', 'b', 'c ') => true + +evaluate.sps:36.17-36.39: error: DEBUG EVALUATE: Function invocation +any(format, string, string, string) does not match any known function. +Candidates are: ANY(number, number[, number]...) -ANY(string, string[, string]...).]], - [[any('a', b, 'c', 'd')], [error], - [error: DEBUG EVALUATE: Unknown identifier b.]], - [[any('a', 'b', c, 'd')], [error], - [error: DEBUG EVALUATE: Unknown identifier c.]], - [[any('a', 'b', 'c', d)], [error], - [error: DEBUG EVALUATE: Unknown identifier d.]], - - [[range(5, 1, 10)], [true]], - [[range(1, 1, 10)], [true]], - [[range(10, 1, 10)], [true]], - [[range(-1, 1, 10)], [false]], - [[range(12, 1, 10)], [false]], - [[range($sysmis, 1, 10)], [sysmis]], - [[range(5, 1, $sysmis)], [sysmis]], - [[range(5, $sysmis, 10)], [sysmis]], - [[range($sysmis, $sysmis, 10)], [sysmis ]], - [[range($sysmis, 1, $sysmis)], [sysmis]], - [[range($sysmis, $sysmis, $sysmis)], [sysmis]], - [[range(0, 1, 8, 10, 18)], [false]], - [[range(1, 1, 8, 10, 18)], [true]], - [[range(6, 1, 8, 10, 18)], [true]], - [[range(8, 1, 8, 10, 18)], [true]], - [[range(9, 1, 8, 10, 18)], [false]], - [[range(10, 1, 8, 10, 18)], [true]], - [[range(13, 1, 8, 10, 18)], [true]], - [[range(16, 1, 8, 10, 18)], [true]], - [[range(18, 1, 8, 10, 18)], [true]], - [[range(20, 1, 8, 10, 18)], [false]], - [[range(1)], [error], - [error: DEBUG EVALUATE: Function invocation range(number) does not match any known function. Candidates are: -RANGE(number, number, number[, number, number]...) -RANGE(string, string, string[, string, string]...).]], - [[range(1, 2)], [error], - [error: DEBUG EVALUATE: RANGE(number, number, number[, number, number]...) must have an odd number of arguments.]], - [[range(1, 2, 3, 4)], [error], - [error: DEBUG EVALUATE: RANGE(number, number, number[, number, number]...) must have an odd number of arguments.]], - [[range(1, 2, 3, 4, 5, 6)], [error], - [error: DEBUG EVALUATE: RANGE(number, number, number[, number, number]...) must have an odd number of arguments.]], - [[range('1', 2, 3)], [error], - [error: DEBUG EVALUATE: Function invocation range(string, number, number) does not match any known function. Candidates are: -RANGE(number, number, number[, number, number]...) -RANGE(string, string, string[, string, string]...).]], - [[range(1, '2', 3)], [error], - [error: DEBUG EVALUATE: Function invocation range(number, string, number) does not match any known function. Candidates are: -RANGE(number, number, number[, number, number]...) -RANGE(string, string, string[, string, string]...).]], - [[range(1, 2, '3')], [error], - [error: DEBUG EVALUATE: Function invocation range(number, number, string) does not match any known function. Candidates are: +ANY(string, string[, string]...). + 36 | DEBUG EVALUATE /any(a10, 'b', 'c', 'd'). + | ^~~~~~~~~~~~~~~~~~~~~~~ + +any(a10, 'b', 'c', 'd') => error + +evaluate.sps:37: error: DEBUG EVALUATE: Unknown identifier b. + +any('a', b, 'c', 'd') => error + +evaluate.sps:38: error: DEBUG EVALUATE: Unknown identifier c. + +any('a', 'b', c, 'd') => error + +evaluate.sps:39: error: DEBUG EVALUATE: Unknown identifier d. + +any('a', 'b', 'c', d) => error +]]) +done +AT_CLEANUP + +AT_SETUP([expressions - RANGE]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. + +DEBUG EVALUATE /range(5, 1, 10). +DEBUG EVALUATE /range(1, 1, 10). +DEBUG EVALUATE /range(10, 1, 10). +DEBUG EVALUATE /range(-1, 1, 10). +DEBUG EVALUATE /range(12, 1, 10). + +DEBUG EVALUATE /range(5, $sysmis, 6, 1, 10). +DEBUG EVALUATE /range(5, $sysmis, $sysmis, 1, 10). +DEBUG EVALUATE /range(1, 1, 10, 6, $sysmis). +DEBUG EVALUATE /range(1, 1, 10, $sysmis, $sysmis). + +DEBUG EVALUATE /range(5, 5, 10, 3, 7). +DEBUG EVALUATE /range(5, 10, 5, 3, 7). +DEBUG EVALUATE /range(5, 3, 7, 5, 10). +DEBUG EVALUATE /range(5, 3, 7, 10, 5). + +DEBUG EVALUATE /range($sysmis, 1, 10). +DEBUG EVALUATE /range(5, 1, $sysmis). +DEBUG EVALUATE /range(5, $sysmis, 10). +DEBUG EVALUATE /range(1, 1, $sysmis). +DEBUG EVALUATE /range(10, $sysmis, 10). +DEBUG EVALUATE /range(5, 10, 5). +DEBUG EVALUATE /range($sysmis, $sysmis, 10). +DEBUG EVALUATE /range($sysmis, 1, $sysmis). +DEBUG EVALUATE /range($sysmis, $sysmis, $sysmis). + +DEBUG EVALUATE /range(0, 1, 8, 10, 18). +DEBUG EVALUATE /range(1, 1, 8, 10, 18). +DEBUG EVALUATE /range(6, 1, 8, 10, 18). +DEBUG EVALUATE /range(8, 1, 8, 10, 18). +DEBUG EVALUATE /range(9, 1, 8, 10, 18). +DEBUG EVALUATE /range(10, 1, 8, 10, 18). +DEBUG EVALUATE /range(13, 1, 8, 10, 18). +DEBUG EVALUATE /range(16, 1, 8, 10, 18). +DEBUG EVALUATE /range(18, 1, 8, 10, 18). +DEBUG EVALUATE /range(20, 1, 8, 10, 18). +DEBUG EVALUATE /range(1). +DEBUG EVALUATE /range(1, 2). +DEBUG EVALUATE /range(1, 2, 3, 4). +DEBUG EVALUATE /range(1, 2, 3, 4, 5, 6). +DEBUG EVALUATE /range('1', 2, 3). +DEBUG EVALUATE /range(1, '2', 3). +DEBUG EVALUATE /range(1, 2, '3'). + +DEBUG EVALUATE /range('123', '111', '888'). +DEBUG EVALUATE /range('111', '111', '888'). +DEBUG EVALUATE /range('888', '111', '888'). +DEBUG EVALUATE /range('110', '111', '888'). +DEBUG EVALUATE /range('889', '111', '888'). +DEBUG EVALUATE /range('000', '111', '888'). +DEBUG EVALUATE /range('999', '111', '888'). + +DEBUG EVALUATE /range('123 ', '111', '888'). +DEBUG EVALUATE /range('123', '111 ', '888'). +DEBUG EVALUATE /range('123', '111', '888 '). +DEBUG EVALUATE /range('123', '111 ', '888 '). + +DEBUG EVALUATE /range('00', '01', '08', '10', '18'). +DEBUG EVALUATE /range('01', '01', '08', '10', '18'). +DEBUG EVALUATE /range('06', '01', '08', '10', '18'). +DEBUG EVALUATE /range('08', '01', '08', '10', '18'). +DEBUG EVALUATE /range('09', '01', '08', '10', '18'). +DEBUG EVALUATE /range('10', '01', '08', '10', '18'). +DEBUG EVALUATE /range('15', '01', '08', '10', '18'). +DEBUG EVALUATE /range('18', '01', '08', '10', '18'). +DEBUG EVALUATE /range('19', '01', '08', '10', '18'). + +DEBUG EVALUATE /range('07', '01', '08', '18', '10'). +DEBUG EVALUATE /range('12', '08', '01', '10', '18'). + +DEBUG EVALUATE /range('1'). +DEBUG EVALUATE /range('1', '2'). +DEBUG EVALUATE /range('1', '2', '3', '4'). +DEBUG EVALUATE /range('1', '2', '3', '4', '5', '6'). +DEBUG EVALUATE /range(1, '2', '3'). +DEBUG EVALUATE /range('1', 2, '3'). +DEBUG EVALUATE /range('1', '2', 3). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], +[[range(5, 1, 10) => true + +range(1, 1, 10) => true + +range(10, 1, 10) => true + +range(-1, 1, 10) => false + +range(12, 1, 10) => false + +range(5, $sysmis, 6, 1, 10) => true + +range(5, $sysmis, $sysmis, 1, 10) => true + +range(1, 1, 10, 6, $sysmis) => true + +range(1, 1, 10, $sysmis, $sysmis) => true + +range(5, 5, 10, 3, 7) => true + +range(5, 10, 5, 3, 7) => sysmis + +range(5, 3, 7, 5, 10) => true + +range(5, 3, 7, 10, 5) => sysmis + +range($sysmis, 1, 10) => sysmis + +range(5, 1, $sysmis) => sysmis + +range(5, $sysmis, 10) => sysmis + +range(1, 1, $sysmis) => sysmis + +range(10, $sysmis, 10) => sysmis + +range(5, 10, 5) => sysmis + +range($sysmis, $sysmis, 10) => sysmis + +range($sysmis, 1, $sysmis) => sysmis + +range($sysmis, $sysmis, $sysmis) => sysmis + +range(0, 1, 8, 10, 18) => false + +range(1, 1, 8, 10, 18) => true + +range(6, 1, 8, 10, 18) => true + +range(8, 1, 8, 10, 18) => true + +range(9, 1, 8, 10, 18) => false + +range(10, 1, 8, 10, 18) => true + +range(13, 1, 8, 10, 18) => true + +range(16, 1, 8, 10, 18) => true + +range(18, 1, 8, 10, 18) => true + +range(20, 1, 8, 10, 18) => false + +evaluate.sps:40.17-40.24: error: DEBUG EVALUATE: Function invocation +range(number) does not match any known function. Candidates are: RANGE(number, number, number[, number, number]...) -RANGE(string, string, string[, string, string]...).]], - - [[range('123', '111', '888')], [true]], - [[range('111', '111', '888')], [true]], - [[range('888', '111', '888')], [true]], - [[range('110', '111', '888')], [false]], - [[range('889', '111', '888')], [false]], - [[range('000', '111', '888')], [false]], - [[range('999', '111', '888')], [false]], - [[range('123 ', '111', '888')], [true]], - [[range('123', '111 ', '888')], [true]], - [[range('123', '111', '888 ')], [true]], - [[range('123', '111 ', '888 ')], [true]], - [[range('00', '01', '08', '10', '18')], [false]], - [[range('01', '01', '08', '10', '18')], [true]], - [[range('06', '01', '08', '10', '18')], [true]], - [[range('08', '01', '08', '10', '18')], [true]], - [[range('09', '01', '08', '10', '18')], [false]], - [[range('10', '01', '08', '10', '18')], [true]], - [[range('15', '01', '08', '10', '18')], [true]], - [[range('18', '01', '08', '10', '18')], [true]], - [[range('19', '01', '08', '10', '18')], [false]], - [[range('1')], [error], - [error: DEBUG EVALUATE: Function invocation range(string) does not match any known function. Candidates are: +RANGE(string, string, string[, string, string]...). + 40 | DEBUG EVALUATE /range(1). + | ^~~~~~~~ + +range(1) => error + +evaluate.sps:41.17-41.27: error: DEBUG EVALUATE: RANGE(number, number, number[, +number, number]...) must have an odd number of arguments. + 41 | DEBUG EVALUATE /range(1, 2). + | ^~~~~~~~~~~ + +range(1, 2) => error + +evaluate.sps:42.17-42.33: error: DEBUG EVALUATE: RANGE(number, number, number[, +number, number]...) must have an odd number of arguments. + 42 | DEBUG EVALUATE /range(1, 2, 3, 4). + | ^~~~~~~~~~~~~~~~~ + +range(1, 2, 3, 4) => error + +evaluate.sps:43.17-43.39: error: DEBUG EVALUATE: RANGE(number, number, number[, +number, number]...) must have an odd number of arguments. + 43 | DEBUG EVALUATE /range(1, 2, 3, 4, 5, 6). + | ^~~~~~~~~~~~~~~~~~~~~~~ + +range(1, 2, 3, 4, 5, 6) => error + +evaluate.sps:44.17-44.32: error: DEBUG EVALUATE: Function invocation +range(string, number, number) does not match any known function. Candidates +are: RANGE(number, number, number[, number, number]...) -RANGE(string, string, string[, string, string]...).]], - [[range('1', '2')], [error], - [error: DEBUG EVALUATE: RANGE(string, string, string[, string, string]...) must have an odd number of arguments.]], - [[range('1', '2', '3', '4')], [error], - [error: DEBUG EVALUATE: RANGE(string, string, string[, string, string]...) must have an odd number of arguments.]], - [[range('1', '2', '3', '4', '5', '6')], [error], - [error: DEBUG EVALUATE: RANGE(string, string, string[, string, string]...) must have an odd number of arguments.]], - [[range(1, '2', '3')], [error], - [error: DEBUG EVALUATE: Function invocation range(number, string, string) does not match any known function. Candidates are: +RANGE(string, string, string[, string, string]...). + 44 | DEBUG EVALUATE /range('1', 2, 3). + | ^~~~~~~~~~~~~~~~ + +range('1', 2, 3) => error + +evaluate.sps:45.17-45.32: error: DEBUG EVALUATE: Function invocation +range(number, string, number) does not match any known function. Candidates +are: RANGE(number, number, number[, number, number]...) -RANGE(string, string, string[, string, string]...).]], - [[range('1', 2, '3')], [error], - [error: DEBUG EVALUATE: Function invocation range(string, number, string) does not match any known function. Candidates are: +RANGE(string, string, string[, string, string]...). + 45 | DEBUG EVALUATE /range(1, '2', 3). + | ^~~~~~~~~~~~~~~~ + +range(1, '2', 3) => error + +evaluate.sps:46.17-46.32: error: DEBUG EVALUATE: Function invocation +range(number, number, string) does not match any known function. Candidates +are: RANGE(number, number, number[, number, number]...) -RANGE(string, string, string[, string, string]...).]], - [[range('1', '2', 3)], [error], - [error: DEBUG EVALUATE: Function invocation range(string, string, number) does not match any known function. Candidates are: +RANGE(string, string, string[, string, string]...). + 46 | DEBUG EVALUATE /range(1, 2, '3'). + | ^~~~~~~~~~~~~~~~ + +range(1, 2, '3') => error + +range('123', '111', '888') => true + +range('111', '111', '888') => true + +range('888', '111', '888') => true + +range('110', '111', '888') => false + +range('889', '111', '888') => false + +range('000', '111', '888') => false + +range('999', '111', '888') => false + +range('123 ', '111', '888') => true + +range('123', '111 ', '888') => true + +range('123', '111', '888 ') => true + +range('123', '111 ', '888 ') => true + +range('00', '01', '08', '10', '18') => false + +range('01', '01', '08', '10', '18') => true + +range('06', '01', '08', '10', '18') => true + +range('08', '01', '08', '10', '18') => true + +range('09', '01', '08', '10', '18') => false + +range('10', '01', '08', '10', '18') => true + +range('15', '01', '08', '10', '18') => true + +range('18', '01', '08', '10', '18') => true + +range('19', '01', '08', '10', '18') => false + +range('07', '01', '08', '18', '10') => sysmis + +range('12', '08', '01', '10', '18') => sysmis + +evaluate.sps:74.17-74.26: error: DEBUG EVALUATE: Function invocation +range(string) does not match any known function. Candidates are: RANGE(number, number, number[, number, number]...) -RANGE(string, string, string[, string, string]...).]], +RANGE(string, string, string[, string, string]...). + 74 | DEBUG EVALUATE /range('1'). + | ^~~~~~~~~~ - [[max(1, 2, 3, 4, 5)], [5.00]], - [[max(1, $sysmis, 2, 3, $sysmis, 4, 5)], [5.00]], - [[max(1, 2)], [2.00]], - [[max()], [error], - [error: DEBUG EVALUATE: Function invocation max() does not match any known function. Candidates are: -MAX(number[, number]...) -MAX(string[, string]...).]], - [[max(1)], [1.00]], - [[max(1, $sysmis)], [1.00]], - [[max(1, 2, 3, $sysmis)], [3.00]], - [[max.4(1, 2, 3, $sysmis)], [sysmis]], - [[max.4(1, 2, 3)], [error], - [error: DEBUG EVALUATE: For MAX(number[, number]...) with 3 arguments, at most 3 (not 4) may be required to be valid.]], - - [[max("2", "3", "5", "1", "4")], ["5"]], - [[max("1", "2")], ["2"]], - [[max("1")], ["1"]], - - [[min(1, 2, 3, 4, 5)], [1.00]], - [[min(1, $sysmis, 2, 3, $sysmis, 4, 5)], [1.00]], - [[min(1, 2)], [1.00]], - [[min()], [error], - [error: DEBUG EVALUATE: Function invocation min() does not match any known function. Candidates are: -MIN(number[, number]...) -MIN(string[, string]...).]], - [[min(1)], [1.00]], - [[min(1, $sysmis)], [1.00]], - [[min(1, 2, 3, $sysmis)], [1.00]], - [[min.4(1, 2, 3, $sysmis)], [sysmis]], - [[min.4(1, 2, 3)], [error], - [error: DEBUG EVALUATE: For MIN(number[, number]...) with 3 arguments, at most 3 (not 4) may be required to be valid.]], - - [[min("2", "3", "5", "1", "4")], ["1"]], - [[min("1", "2")], ["1"]], - [[min("1")], ["1"]]) - -CHECK_EXPR_EVAL([cfvar mean median sd sum variance], - [[cfvar(1, 2, 3, 4, 5)], [0.53]], - [[cfvar(1, $sysmis, 2, 3, $sysmis, 4, 5)], [0.53]], - [[cfvar(1, 2)], [0.47]], - [[cfvar(1)], [error], - [error: DEBUG EVALUATE: Type mismatch invoking CFVAR(number, number[, number]...) as cfvar(number).]], - [[cfvar(1, $sysmis)], [sysmis]], - [[cfvar(1, 2, 3, $sysmis)], [0.50]], - [[cfvar.4(1, 2, 3, $sysmis)], [sysmis]], - [[cfvar.4(1, 2, 3)], [error], - [error: DEBUG EVALUATE: For CFVAR(number, number[, number]...) with 3 arguments, at most 3 (not 4) may be required to be valid.]], - [[cfvar('x')], [error], - [error: DEBUG EVALUATE: Type mismatch invoking CFVAR(number, number[, number]...) as cfvar(string).]], - [[cfvar('x', 1, 2, 3)], [error], - [error: DEBUG EVALUATE: Type mismatch invoking CFVAR(number, number[, number]...) as cfvar(string, number, number, number).]], - - [[mean(1, 2, 3, 4, 5)], [3.00]], - [[mean(1, $sysmis, 2, 3, $sysmis, 4, 5)], [3.00]], - [[mean(1, 2)], [1.50]], - [[mean()], [error], - [error: DEBUG EVALUATE: Type mismatch invoking MEAN(number[, number]...) as mean().]], - [[mean(1)], [1.00]], - [[mean(1, $sysmis)], [1.00]], - [[mean(1, 2, 3, $sysmis)], [2.00]], - [[mean.4(1, 2, 3, $sysmis)], [sysmis]], - [[mean.4(1, 2, 3)], [error], - [error: DEBUG EVALUATE: For MEAN(number[, number]...) with 3 arguments, at most 3 (not 4) may be required to be valid.]], - - [[median(1, 2, 3, 4, 5)], [3.00]], - [[median(2, 3, 4, 5, 1)], [3.00]], - [[median(2, 3, 4, 1, 5)], [3.00]], - [[median(2, 1, 4, 5, 3)], [3.00]], - [[median(1, 2, 3, 4)], [2.50]], - [[median(2, 3, 1, 4)], [2.50]], - [[median(2, 3, 4, 1)], [2.50]], - [[median(2, 1, 4, 3)], [2.50]], - [[median(1, $sysmis, 3, 4, 5)], [3.50]], - [[median(2, 3, 4, 5, $sysmis, 1)], [3.00]], - [[median($sysmis, $sysmis, $sysmis, 2, 3, 4, 1, 5)], [3.00]], - [[median(1, 2, 3)], [2.00]], - [[median(1)], [1.00]], - [[median(1, 2)], [1.50]], - [[median(1, 2, $sysmis)], [1.50]], - [[median(1, $sysmis, $sysmis)], [1.00]], - [[median($sysmis, $sysmis, $sysmis)], [sysmis]], - [[median.3(1, 2, $sysmis)], [sysmis]], - [[median.2(1, $sysmis)], [sysmis]], - - [[sd(1, 2, 3, 4, 5)], [1.58]], - [[sd(1, $sysmis, 2, 3, $sysmis, 4, 5)], [1.58]], - [[sd(1, 2)], [0.71]], - [[sd(1)], [error], - [error: DEBUG EVALUATE: Type mismatch invoking SD(number, number[, number]...) as sd(number).]], - [[sd(1, $sysmis)], [sysmis]], - [[sd(1, 2, 3, $sysmis)], [1.00]], - [[sd.4(1, 2, 3, $sysmis)], [sysmis]], - [[sd.4(1, 2, 3)], [error], - [error: DEBUG EVALUATE: For SD(number, number[, number]...) with 3 arguments, at most 3 (not 4) may be required to be valid.]], - [[sd('x')], [error], - [error: DEBUG EVALUATE: Type mismatch invoking SD(number, number[, number]...) as sd(string).]], - [[sd('x', 1, 2, 3)], [error], - [error: DEBUG EVALUATE: Type mismatch invoking SD(number, number[, number]...) as sd(string, number, number, number).]], - - [[sum(1, 2, 3, 4, 5)], [15.00]], - [[sum(1, $sysmis, 2, 3, $sysmis, 4, 5)], [15.00]], - [[sum(1, 2)], [3.00]], - [[sum()], [error], - [error: DEBUG EVALUATE: Type mismatch invoking SUM(number[, number]...) as sum().]], - [[sum(1)], [1.00]], - [[sum(1, $sysmis)], [1.00]], - [[sum(1, 2, 3, $sysmis)], [6.00]], - [[sum.4(1, 2, 3, $sysmis)], [sysmis]], - [[sum.4(1, 2, 3)], [error], - [error: DEBUG EVALUATE: For SUM(number[, number]...) with 3 arguments, at most 3 (not 4) may be required to be valid.]], - - [[variance(1, 2, 3, 4, 5)], [2.50]], - [[variance(1, $sysmis, 2, 3, $sysmis, 4, 5)], [2.50]], - [[variance(1, 2)], [0.50]], - [[variance(1)], [error], - [error: DEBUG EVALUATE: Type mismatch invoking VARIANCE(number, number[, number]...) as variance(number).]], - [[variance(1, $sysmis)], [sysmis]], - [[variance(1, 2, 3, $sysmis)], [1.00]], - [[variance.4(1, 2, 3, $sysmis)], [sysmis]], - [[variance.4(1, 2, 3)], [error], - [error: DEBUG EVALUATE: For VARIANCE(number, number[, number]...) with 3 arguments, at most 3 (not 4) may be required to be valid.]], - [[variance('x')], [error], - [error: DEBUG EVALUATE: Type mismatch invoking VARIANCE(number, number[, number]...) as variance(string).]], - [[variance('x', 1, 2, 3)], [error], - [error: DEBUG EVALUATE: Type mismatch invoking VARIANCE(number, number[, number]...) as variance(string, number, number, number).]]) - -CHECK_EXPR_EVAL([concat index rindex length lower], - [[concat('')], [""]], - [[concat('a', 'b')], ["ab"]], - [[concat('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h')], ["abcdefgh"]], - [[concat('abcdefgh', 'ijklmnopq')], ["abcdefghijklmnopq"]], - [[concat('a', 1)], [error], - [error: DEBUG EVALUATE: Type mismatch invoking CONCAT(string[, string]...) as concat(string, number).]], - [[concat(1, 2)], [error], - [error: DEBUG EVALUATE: Type mismatch invoking CONCAT(string[, string]...) as concat(number, number).]], - - [[index('abcbcde', 'bc')], [2.00]], - [[index('abcbcde', 'bcd')], [4.00]], - [[index('abcbcde', 'bcbc')], [2.00]], - [[index('abcdefgh', 'abc')], [1.00]], - [[index('abcdefgh', 'bcd')], [2.00]], - [[index('abcdefgh', 'cde')], [3.00]], - [[index('abcdefgh', 'def')], [4.00]], - [[index('abcdefgh', 'efg')], [5.00]], - [[index('abcdefgh', 'fgh')], [6.00]], - [[index('abcdefgh', 'fghi')], [0.00]], - [[index('abcdefgh', 'x')], [0.00]], - [[index('abcdefgh', 'abch')], [0.00]], - [[index('banana', 'na')], [3.00]], - [[index('banana', 'ana')], [2.00]], - [[index('', 'x')], [0.00]], - [[index('', '')], [sysmis]], - [[index('abcdefgh', '')], [sysmis]], - [[index('abcdefgh', 'alkjsfdjlskalkjfa')], [0.00]], - - [[index('abcbcde', 'bc', 1)], [2.00]], - [[index('abcbcde', 'dc', 1)], [3.00]], - [[index('abcbcde', 'abc', 1)], [1.00]], - [[index('abcbcde', 'bc', 2)], [2.00]], - [[index('abcbcde', 'dc', 2)], [0.00]], - [[index('abcbcde', 'abc', 1)], [1.00]], - [[index('abcbcde', 'bccb', 2)], [2.00]], - [[index('abcbcde', 'bcbc', 2)], [2.00]], - [[index('abcbcde', 'bcbc', $sysmis)], [sysmis]], - - [[rindex('abcbcde', 'bc')], [4.00]], - [[rindex('abcbcde', 'bcd')], [4.00]], - [[rindex('abcbcde', 'bcbc')], [2.00]], - [[rindex('abcdefgh', 'abc')], [1.00]], - [[rindex('abcdefgh', 'bcd')], [2.00]], - [[rindex('abcdefgh', 'cde')], [3.00]], - [[rindex('abcdefgh', 'def')], [4.00]], - [[rindex('abcdefgh', 'efg')], [5.00]], - [[rindex('abcdefgh', 'fgh')], [6.00]], - [[rindex('abcdefgh', 'fghi')], [0.00]], - [[rindex('abcdefgh', 'x')], [0.00]], - [[rindex('abcdefgh', 'abch')], [0.00]], - [[rindex('banana', 'na')], [5.00]], - [[rindex('banana', 'ana')], [4.00]], - [[rindex('', 'x')], [0.00]], - [[rindex('', '')], [sysmis]], - [[rindex('abcdefgh', '')], [sysmis]], - [[rindex('abcdefgh', 'alkjsfdjlskalkjfa')], [0.00]], - - [[rindex('abcbcde', 'bc', 1)], [5.00]], - [[rindex('abcbcde', 'dc', 1)], [6.00]], - [[rindex('abcbcde', 'abc', 1)], [5.00]], - [[rindex('abcbcde', 'bc', 2)], [4.00]], - [[rindex('abcbcde', 'dc', 2)], [0.00]], - [[rindex('abcbcde', 'abc', 1)], [5.00]], - [[rindex('abcbcde', 'bccb', 2)], [4.00]], - [[rindex('abcbcde', 'bcbc', 2)], [4.00]], - [[rindex('abcbcde', 'bcbc', 0)], [sysmis]], - [[rindex('abcbcde', 'bcbc', $sysmis)], [sysmis]], - [[rindex('abcbcde', 'bcbcg', 2)], [sysmis]], - [[rindex('abcbcde', 'bcbcg', $sysmis)], [sysmis]], - [[rindex('abcbcde', 'bcbcg', 'x')], [error], - [error: DEBUG EVALUATE: Function invocation rindex(string, string, string) does not match any known function. Candidates are: -RINDEX(string, string) -RINDEX(string, string, number).]], - [[rindex(1, 'bcdfkjl', 2)], [error], - [error: DEBUG EVALUATE: Function invocation rindex(number, string, number) does not match any known function. Candidates are: -RINDEX(string, string) -RINDEX(string, string, number).]], - [[rindex('aksj', 2, 2)], [error], - [error: DEBUG EVALUATE: Function invocation rindex(string, number, number) does not match any known function. Candidates are: -RINDEX(string, string) -RINDEX(string, string, number).]], - [[rindex(1, 2, 3)], [error], - [error: DEBUG EVALUATE: Function invocation rindex(number, number, number) does not match any known function. Candidates are: -RINDEX(string, string) -RINDEX(string, string, number).]], - [[rindex(1, 2, '3')], [error], - [error: DEBUG EVALUATE: Function invocation rindex(number, number, string) does not match any known function. Candidates are: -RINDEX(string, string) -RINDEX(string, string, number).]], - - [[length('')], [0.00]], - [[length('a')], [1.00]], - [[length('xy')], [2.00]], - [[length('adsf ')], [8.00]], - [[length('abcdefghijkl')], [12.00]], - [[length(0)], [error], - [error: DEBUG EVALUATE: Type mismatch invoking LENGTH(string) as length(number).]], - [[length($sysmis)], [error], - [error: DEBUG EVALUATE: Type mismatch invoking LENGTH(string) as length(number).]], - - [[lower('ABCDEFGHIJKLMNOPQRSTUVWXYZ!@%&*089')], ["abcdefghijklmnopqrstuvwxyz!@%&*089"]], - [[lower('')], [""]], - [[lower(1)], [error], - [error: DEBUG EVALUATE: Type mismatch invoking LOWER(string) as lower(number).]]) - -CHECK_EXPR_EVAL([replace], - [[replace('banana', 'an', 'AN')], ["bANANa"]], - [[replace('banana', 'an', 'a')], ["baaa"]], - [[replace('banana', 'an', '')], ["ba"]], - [[replace('banana', 'na', '')], ["ba"]], - [[replace('banana', 'ba', 'BA')], ["BAnana"]], - [[replace('banana', 'na', 'xyzzy')], ["baxyzzyxyzzy"]], - [[replace('banana', 'an', 'xyzzy', 1)], ["bxyzzyana"]], - [[replace('banana', 'an', 'xyzzy', 1.5)], ["bxyzzyana"]], - [[replace('banana', 'bananana', 'xyzzy')], ["banana"]], - [[replace('banana', '', 'xyzzy')], ["banana"]], - [[replace('banana', 'ba', '', 0)], ["banana"]], - [[replace('banana', 'ba', '', -1)], ["banana"]], - [[replace('banana', 'ba', '', $sysmis)], ["banana"]]) - -CHECK_EXPR_EVAL([lpad number ltrim lpad rtrim rpad string strunc substr upcase], - [[lpad('abc', -1)], [""]], - [[lpad('abc', 0)], ["abc"]], - [[lpad('abc', 2)], ["abc"]], - [[lpad('abc', 3)], ["abc"]], - [[lpad('abc', 10)], [" abc"]], - [[lpad('abc', 32768)], [""]], - [[lpad('abc', $sysmis)], [""]], - [[lpad('abc', -1, '*')], [""]], - [[lpad('abc', 0, '*')], ["abc"]], - [[lpad('abc', 2, '*')], ["abc"]], - [[lpad('abc', 3, '*')], ["abc"]], - [[lpad('abc', 10, '*')], ["*******abc"]], - [[lpad('abc', 32768, '*')], [""]], - [[lpad('abc', $sysmis, '*')], [""]], - [[lpad('abc', $sysmis, '')], [""]], - [[lpad('abc', $sysmis, 'xy')], [""]], - [[lpad(0, 10)], [error], - [error: DEBUG EVALUATE: Function invocation lpad(number, number) does not match any known function. Candidates are: -LPAD(string, number) -LPAD(string, number, string).]], - [[lpad('abc', 'def')], [error], - [error: DEBUG EVALUATE: Function invocation lpad(string, string) does not match any known function. Candidates are: -LPAD(string, number) -LPAD(string, number, string).]], - [[lpad(0, 10, ' ')], [error], - [error: DEBUG EVALUATE: Function invocation lpad(number, number, string) does not match any known function. Candidates are: -LPAD(string, number) -LPAD(string, number, string).]], - [[lpad('abc', 'def', ' ')], [error], - [error: DEBUG EVALUATE: Function invocation lpad(string, string, string) does not match any known function. Candidates are: -LPAD(string, number) -LPAD(string, number, string).]], - [[lpad('x', 5, 0)], [error], - [error: DEBUG EVALUATE: Function invocation lpad(string, number, number) does not match any known function. Candidates are: -LPAD(string, number) -LPAD(string, number, string).]], - [[lpad('x', 5, 2)], [error], - [error: DEBUG EVALUATE: Function invocation lpad(string, number, number) does not match any known function. Candidates are: -LPAD(string, number) -LPAD(string, number, string).]], - - [[number("123", f3.0)], [123.00]], - [[number(" 123", f3.0)], [12.00]], - [[number("123", f3.1)], [12.30]], - [[number(" ", f3.1)], [sysmis]], - [[number("123", a8)], [error], - [error: DEBUG EVALUATE: Type mismatch invoking NUMBER(string, num_input_format) as number(string, format).]], -dnl CCA is not an input format: - [[number("123", cca1.2)], [error], - [error: DEBUG EVALUATE: Type mismatch invoking NUMBER(string, num_input_format) as number(string, format).]], - - [[ltrim(' abc')], ["abc"]], - [[rtrim(' abc ')], [" abc"]], - [[ltrim('abc')], ["abc"]], - [[ltrim(' abc')], [" abc"]], - [[ltrim(' ')], [""]], - [[ltrim('')], [""]], - [[ltrim(8)], [error], - [error: DEBUG EVALUATE: Function invocation ltrim(number) does not match any known function. Candidates are: -LTRIM(string) -LTRIM(string, string).]], - [[ltrim('***abc', '*')], ["abc"]], - [[ltrim('abc', '*')], ["abc"]], - [[ltrim('*abc', '*')], ["abc"]], - [[ltrim('', '*')], [""]], - [[ltrim(8, '*')], [error], - [error: DEBUG EVALUATE: Function invocation ltrim(number, string) does not match any known function. Candidates are: -LTRIM(string) -LTRIM(string, string).]], - [[ltrim(' x', 8)], [error], - [error: DEBUG EVALUATE: Function invocation ltrim(string, number) does not match any known function. Candidates are: -LTRIM(string) -LTRIM(string, string).]], - [[ltrim(8, 9)], [error], - [error: DEBUG EVALUATE: Function invocation ltrim(number, number) does not match any known function. Candidates are: -LTRIM(string) -LTRIM(string, string).]], - - [[rpad('abc', -1)], [""]], - [[rpad('abc', 0)], ["abc"]], - [[rpad('abc', 2)], ["abc"]], - [[rpad('abc', 3)], ["abc"]], - [[rpad('abc', 10)], ["abc "]], - [[rpad('abc', 32768)], [""]], - [[rpad('abc', $sysmis)], [""]], - [[rpad('abc', -1, '*')], [""]], - [[rpad('abc', 0, '*')], ["abc"]], - [[rpad('abc', 2, '*')], ["abc"]], - [[rpad('abc', 3, '*')], ["abc"]], - [[rpad('abc', 10, '*')], ["abc*******"]], - [[rpad('abc', 32768, '*')], [""]], - [[rpad('abc', $sysmis, '*')], [""]], - [[rpad('abc', $sysmis, '')], [""]], - [[rpad('abc', $sysmis, 'xy')], [""]], - [[rpad(0, 10)], [error], - [error: DEBUG EVALUATE: Function invocation rpad(number, number) does not match any known function. Candidates are: -RPAD(string, number) -RPAD(string, number, string).]], - [[rpad('abc', 'def')], [error], - [error: DEBUG EVALUATE: Function invocation rpad(string, string) does not match any known function. Candidates are: -RPAD(string, number) -RPAD(string, number, string).]], - [[rpad(0, 10, ' ')], [error], - [error: DEBUG EVALUATE: Function invocation rpad(number, number, string) does not match any known function. Candidates are: -RPAD(string, number) -RPAD(string, number, string).]], - [[rpad('abc', 'def', ' ')], [error], - [error: DEBUG EVALUATE: Function invocation rpad(string, string, string) does not match any known function. Candidates are: -RPAD(string, number) -RPAD(string, number, string).]], - [[rpad('x', 5, 0)], [error], - [error: DEBUG EVALUATE: Function invocation rpad(string, number, number) does not match any known function. Candidates are: -RPAD(string, number) -RPAD(string, number, string).]], - [[rpad('x', 5, 2)], [error], - [error: DEBUG EVALUATE: Function invocation rpad(string, number, number) does not match any known function. Candidates are: -RPAD(string, number) -RPAD(string, number, string).]], - - [[rtrim('abc ')], ["abc"]], - [[rtrim(' abc ')], [" abc"]], - [[rtrim('abc')], ["abc"]], - [[rtrim('abc ')], ["abc "]], - [[rtrim(' ')], [""]], - [[rtrim('')], [""]], - [[rtrim(8)], [error], - [error: DEBUG EVALUATE: Function invocation rtrim(number) does not match any known function. Candidates are: -RTRIM(string) -RTRIM(string, string).]], - [[rtrim('abc***', '*')], ["abc"]], - [[rtrim('abc', '*')], ["abc"]], - [[rtrim('abc*', '*')], ["abc"]], - [[rtrim('', '*')], [""]], - [[rtrim(8, '*')], [error], - [error: DEBUG EVALUATE: Function invocation rtrim(number, string) does not match any known function. Candidates are: -RTRIM(string) -RTRIM(string, string).]], - [[rtrim(' x', 8)], [error], - [error: DEBUG EVALUATE: Function invocation rtrim(string, number) does not match any known function. Candidates are: -RTRIM(string) -RTRIM(string, string).]], - [[rtrim(8, 9)], [error], - [error: DEBUG EVALUATE: Function invocation rtrim(number, number) does not match any known function. Candidates are: -RTRIM(string) -RTRIM(string, string).]], +range('1') => error - [[string(123.56, f5.1)], ["123.6"]], - [[string($sysmis, f5.1)], [" . "]], - [[string("abc", A5)], [error], - [error: DEBUG EVALUATE: Type mismatch invoking STRING(number, num_output_format) as string(string, format).]], -dnl E has a minimum width of 6 on output: - [[string(123, e1)], [error], - [error: DEBUG EVALUATE: Type mismatch invoking STRING(number, num_output_format) as string(number, format).]], - [[string(123, e6.0)], ["1E+002"]], - - [[strunc('a c ', 9)], ["a c"]], - [[strunc('a c ', 7)], ["a c"]], - [[strunc('a c ', 6)], ["a c"]], - [[strunc('a c ', 5)], ["a c"]], - [[strunc('a c ', 4)], ["a c"]], - [[strunc('a c ', 3)], ["a c"]], - [[strunc('a c ', 2)], ["a"]], - [[strunc('a c ', 1)], ["a"]], - [[strunc('a c ', 0)], [""]], - [[strunc('a c ', -1)], [""]], - [[strunc('a c ', $sysmis)], [""]], - [[strunc(' abc ', 9)], [" abc"]], - [[strunc(' abc ', 8)], [" abc"]], - [[strunc(' abc ', 7)], [" abc"]], - [[strunc(' abc ', 6)], [" abc"]], - [[strunc(' abc ', 5)], [" abc"]], - [[strunc(' abc ', 4)], [" ab"]], - [[strunc(' abc ', 3)], [" a"]], - [[strunc(' abc ', 2)], [""]], - [[strunc(' abc ', 1)], [""]], - [[strunc(' abc ', -1)], [""]], - [[strunc(' abc ', $sysmis)], [""]], - - [[substr('abcdefgh', -5)], [""]], - [[substr('abcdefgh', 0)], [""]], - [[substr('abcdefgh', 1)], ["abcdefgh"]], - [[substr('abcdefgh', 3)], ["cdefgh"]], - [[substr('abcdefgh', 5)], ["efgh"]], - [[substr('abcdefgh', 6)], ["fgh"]], - [[substr('abcdefgh', 7)], ["gh"]], - [[substr('abcdefgh', 8)], ["h"]], - [[substr('abcdefgh', 9)], [""]], - [[substr('abcdefgh', 10)], [""]], - [[substr('abcdefgh', 20)], [""]], - [[substr('abcdefgh', $sysmis)], [""]], - [[substr(0, 10)], [error], - [error: DEBUG EVALUATE: Function invocation substr(number, number) does not match any known function. Candidates are: -SUBSTR(string, number) -SUBSTR(string, number, number).]], - [[substr('abcd', 'abc')], [error], - [error: DEBUG EVALUATE: Function invocation substr(string, string) does not match any known function. Candidates are: -SUBSTR(string, number) -SUBSTR(string, number, number).]], - [[substr(0, 'abc')], [error], - [error: DEBUG EVALUATE: Function invocation substr(number, string) does not match any known function. Candidates are: -SUBSTR(string, number) -SUBSTR(string, number, number).]], - - [[substr('abcdefgh', 0, 0)], [""]], - [[substr('abcdefgh', 3, 0)], [""]], - [[substr('abcdefgh', 5, 0)], [""]], - [[substr('abcdefgh', 9, 0)], [""]], - [[substr('abcdefgh', 0, 1)], [""]], - [[substr('abcdefgh', 0, 5)], [""]], - [[substr('abcdefgh', 1, 8)], ["abcdefgh"]], - [[substr('abcdefgh', 1, 10)], ["abcdefgh"]], - [[substr('abcdefgh', 1, 20)], ["abcdefgh"]], - [[substr('abcdefgh', 3, 4)], ["cdef"]], - [[substr('abcdefgh', 5, 2)], ["ef"]], - [[substr('abcdefgh', 6, 1)], ["f"]], - [[substr('abcdefgh', 7, 10)], ["gh"]], - [[substr('abcdefgh', 8, 1)], ["h"]], - [[substr('abcdefgh', 8, 2)], ["h"]], - [[substr('abcdefgh', 9, 11)], [""]], - [[substr('abcdefgh', 10, 52)], [""]], - [[substr('abcdefgh', 20, 1)], [""]], - [[substr('abcdefgh', $sysmis, 2)], [""]], - [[substr('abcdefgh', 9, $sysmis)], [""]], - [[substr('abcdefgh', $sysmis, $sysmis)], [""]], - [[substr('abc', 1, 'x')], [error], - [error: DEBUG EVALUATE: Function invocation substr(string, number, string) does not match any known function. Candidates are: -SUBSTR(string, number) -SUBSTR(string, number, number).]], - [[substr(0, 10, 1)], [error], - [error: DEBUG EVALUATE: Function invocation substr(number, number, number) does not match any known function. Candidates are: -SUBSTR(string, number) -SUBSTR(string, number, number).]], - [[substr(0, 10, 'x')], [error], - [error: DEBUG EVALUATE: Function invocation substr(number, number, string) does not match any known function. Candidates are: -SUBSTR(string, number) -SUBSTR(string, number, number).]], - [[substr('abcd', 'abc', 0)], [error], - [error: DEBUG EVALUATE: Function invocation substr(string, string, number) does not match any known function. Candidates are: -SUBSTR(string, number) -SUBSTR(string, number, number).]], - [[substr('abcd', 'abc', 'j')], [error], - [error: DEBUG EVALUATE: Function invocation substr(string, string, string) does not match any known function. Candidates are: -SUBSTR(string, number) -SUBSTR(string, number, number).]], - [[substr(0, 'abc', 4)], [error], - [error: DEBUG EVALUATE: Function invocation substr(number, string, number) does not match any known function. Candidates are: -SUBSTR(string, number) -SUBSTR(string, number, number).]], - [[substr(0, 'abc', 'k')], [error], - [error: DEBUG EVALUATE: Function invocation substr(number, string, string) does not match any known function. Candidates are: -SUBSTR(string, number) -SUBSTR(string, number, number).]], - - [[upcase('abcdefghijklmnopqrstuvwxyz!@%&*089')], ["ABCDEFGHIJKLMNOPQRSTUVWXYZ!@%&*089"]], - [[upcase('')], [""]], - [[upcase(1)], [error], - [error: DEBUG EVALUATE: Type mismatch invoking UPCASE(string) as upcase(number).]]) - -CHECK_EXPR_EVAL([time ctime date yrmoda], - [[time.days(1)], [86400.00]], - [[time.days(-1)], [-86400.00]], - [[time.days(0.5)], [43200.00]], - [[time.days('x')], [error], - [error: DEBUG EVALUATE: Type mismatch invoking TIME.DAYS(number) as time.days(string).]], - [[time.days($sysmis)], [sysmis]], - - [[time.hms(4,50,38)], [17438.00]], - [[time.hms(12,31,35)], [45095.00]], - [[time.hms(12,47,53)], [46073.00]], - [[time.hms(1,26,0)], [5160.00]], - [[time.hms(20,58,11)], [75491.00]], - [[time.hms(7,36,5)], [27365.00]], - [[time.hms(15,43,49)], [56629.00]], - [[time.hms(4,25,9)], [15909.00]], - [[time.hms(6,49,27)], [24567.00]], - [[time.hms(2,57,52)], [10672.00]], - [[time.hms(16,45,44)], [60344.00]], - [[time.hms(21,30,57)], [77457.00]], - [[time.hms(22,30,4)], [81004.00]], - [[time.hms(1,56,51)], [7011.00]], - [[time.hms(5, 6, 7)], [18367.00]], - [[time.hms(5, 6, 0)], [18360.00]], - [[time.hms(5, 0, 7)], [18007.00]], - [[time.hms(0, 6, 7)], [367.00]], - [[time.hms(-5, 6, -7)], [sysmis], - [warning: DEBUG EVALUATE: TIME.HMS cannot mix positive and negative arguments.]], - [[time.hms(-5, 5, -7)], [sysmis], - [warning: DEBUG EVALUATE: TIME.HMS cannot mix positive and negative arguments.]], - [[time.hms($sysmis, 6, 7)], [sysmis]], - [[time.hms(5, $sysmis, 7)], [sysmis]], - [[time.hms(5, $sysmis, 7)], [sysmis]], - [[time.hms($sysmis, $sysmis, 7)], [sysmis]], - [[time.hms(5, $sysmis, $sysmis)], [sysmis]], - [[time.hms($sysmis, $sysmis, 7)], [sysmis]], - [[time.hms($sysmis, $sysmis, $sysmis)], [sysmis]], - - [[ctime.days(106272)], [1.23]], - [[ctime.hours(106272)], [29.52]], - [[ctime.minutes(106272)], [1771.20]], - [[ctime.seconds(106272)], [106272.00]], - [[ctime.days(-106272)], [-1.23]], - [[ctime.hours(-106272)], [-29.52]], - [[ctime.minutes(-106272)], [-1771.20]], - [[ctime.seconds(-106272)], [-106272.00]], - [[ctime.days($sysmis)], [sysmis]], - [[ctime.hours($sysmis)], [sysmis]], - [[ctime.minutes($sysmis)], [sysmis]], - [[ctime.seconds($sysmis)], [sysmis]], - [[ctime.days('a')], [error], - [error: DEBUG EVALUATE: Type mismatch invoking CTIME.DAYS(number) as ctime.days(string).]], - [[ctime.hours('b')], [error], - [error: DEBUG EVALUATE: Type mismatch invoking CTIME.HOURS(number) as ctime.hours(string).]], - [[ctime.minutes('c')], [error], - [error: DEBUG EVALUATE: Type mismatch invoking CTIME.MINUTES(number) as ctime.minutes(string).]], - [[ctime.seconds('d')], [error], - [error: DEBUG EVALUATE: Type mismatch invoking CTIME.SECONDS(number) as ctime.seconds(string).]], - - [[ctime.days(date.dmy(15,10,1582))], [1.00]], - [[ctime.days(date.dmy(6,9,1719))], [50000.00]], - [[ctime.days(date.dmy(24,1,1583))], [102.00]], - [[ctime.days(date.dmy(14,12,1585))], [1157.00]], - [[ctime.days(date.dmy(26,11,1621))], [14288.00]], - [[ctime.days(date.dmy(25,12,1821))], [87365.00]], - [[ctime.days(date.dmy(3,12,1882))], [109623.00]], - [[ctime.days(date.dmy(6,4,2002))], [153211.00]], - [[ctime.days(date.dmy(19,12,1999))], [152372.00]], - [[ctime.days(date.dmy(1,10,1978))], [144623.00]], - [[ctime.days(date.dmy(0,10,1978))], [144622.00]], - [[ctime.days(date.dmy(32,10,1978))], [sysmis], - [error: DEBUG EVALUATE: Day 32 is not in acceptable range of 0 to 31.]], - [[ctime.days(date.dmy(31,0,1978))], [144349.00]], - [[ctime.days(date.dmy(31,13,1978))], [144745.00]], - [[ctime.days(date.dmy($sysmis,10,1978))], [sysmis]], - [[ctime.days(date.dmy(31,$sysmis,1978))], [sysmis]], - [[ctime.days(date.dmy(31,10,$sysmis))], [sysmis]], - [[ctime.days(date.dmy($sysmis,$sysmis,1978))], [sysmis]], - [[ctime.days(date.dmy(31,$sysmis,$sysmis))], [sysmis]], - [[ctime.days(date.dmy($sysmis,10,$sysmis))], [sysmis]], - [[ctime.days(date.dmy($sysmis,$sysmis,$sysmis))], [sysmis]], - [[date.dmy('a',1,2)], [error], - [error: DEBUG EVALUATE: Type mismatch invoking DATE.DMY(number, number, number) as date.dmy(string, number, number).]], - [[date.dmy(1,'a',2)], [error], - [error: DEBUG EVALUATE: Type mismatch invoking DATE.DMY(number, number, number) as date.dmy(number, string, number).]], - [[date.dmy(1,2,'a')], [error], - [error: DEBUG EVALUATE: Type mismatch invoking DATE.DMY(number, number, number) as date.dmy(number, number, string).]], -dnl FIXME: check out-of-range and nearly out-of-range values -dnl - [[yrmoda(1582,10,15)], [1.00]], - [[yrmoda(1719,9,6)], [50000.00]], - [[yrmoda(1583,1,24)], [102.00]], - [[yrmoda(1585,12,14)], [1157.00]], - [[yrmoda(1621,11,26)], [14288.00]], - [[yrmoda(1821,12,25)], [87365.00]], - [[yrmoda(1882,12,3)], [109623.00]], - [[yrmoda(2002,4,6)], [153211.00]], - [[yrmoda(1999,12,19)], [152372.00]], - [[yrmoda(1978,10,1)], [144623.00]], - [[yrmoda(1978,10,0)], [144622.00]], - [[yrmoda(1978,10,32)], [sysmis], - [error: DEBUG EVALUATE: Day 32 is not in acceptable range of 0 to 31.]], - [[yrmoda(1978,0,31)], [144349.00]], - [[yrmoda(1978,13,31)], [144745.00]], - [[yrmoda(1978,10,$sysmis)], [sysmis]], - [[yrmoda(1978,$sysmis,31)], [sysmis]], - [[yrmoda($sysmis,10,31)], [sysmis]], - [[yrmoda(1978,$sysmis,$sysmis)], [sysmis]], - [[yrmoda($sysmis,$sysmis,31)], [sysmis]], - [[yrmoda($sysmis,10,$sysmis)], [sysmis]], - [[yrmoda($sysmis,$sysmis,$sysmis)], [sysmis]], - [[yrmoda('a',1,2)], [error], - [error: DEBUG EVALUATE: Type mismatch invoking YRMODA(number, number, number) as yrmoda(string, number, number).]], - [[yrmoda(1,'a',2)], [error], - [error: DEBUG EVALUATE: Type mismatch invoking YRMODA(number, number, number) as yrmoda(number, string, number).]], - [[yrmoda(1,2,'a')], [error], - [error: DEBUG EVALUATE: Type mismatch invoking YRMODA(number, number, number) as yrmoda(number, number, string).]], -dnl FIXME: check out-of-range and nearly out-of-range values -dnl - [[ctime.days(date.mdy(6,10,1648)) + 577735], [601716.00]], - [[ctime.days(date.mdy(6,30,1680)) + 577735], [613424.00]], - [[ctime.days(date.mdy(7,24,1716)) + 577735], [626596.00]], - [[ctime.days(date.mdy(6,19,1768)) + 577735], [645554.00]], - [[ctime.days(date.mdy(8,2,1819)) + 577735], [664224.00]], - [[ctime.days(date.mdy(3,27,1839)) + 577735], [671401.00]], - [[ctime.days(date.mdy(4,19,1903)) + 577735], [694799.00]], - [[ctime.days(date.mdy(8,25,1929)) + 577735], [704424.00]], - [[ctime.days(date.mdy(9,29,1941)) + 577735], [708842.00]], - [[ctime.days(date.mdy(4,19,1943)) + 577735], [709409.00]], - [[ctime.days(date.mdy(10,7,1943)) + 577735], [709580.00]], - [[ctime.days(date.mdy(3,17,1992)) + 577735], [727274.00]], - [[ctime.days(date.mdy(2,25,1996)) + 577735], [728714.00]], - [[ctime.days(date.mdy(11,10,2038)) + 577735], [744313.00]], - [[ctime.days(date.mdy(7,18,2094)) + 577735], [764652.00]], -dnl FIXME: check out-of-range and nearly out-of-range values -dnl - [[ctime.days(date.mdy(10,15,1582))], [1.00]], - [[ctime.days(date.mdy(9,6,1719))], [50000.00]], - [[ctime.days(date.mdy(1,24,1583))], [102.00]], - [[ctime.days(date.mdy(12,14,1585))], [1157.00]], - [[ctime.days(date.mdy(11,26,1621))], [14288.00]], - [[ctime.days(date.mdy(12,25,1821))], [87365.00]], - [[ctime.days(date.mdy(12,3,1882))], [109623.00]], - [[ctime.days(date.mdy(4,6,2002))], [153211.00]], - [[ctime.days(date.mdy(12,19,1999))], [152372.00]], - [[ctime.days(date.mdy(10,1,1978))], [144623.00]], - [[ctime.days(date.mdy(10,0,1978))], [144622.00]], - [[ctime.days(date.mdy(10,32,1978))], [sysmis], - [error: DEBUG EVALUATE: Day 32 is not in acceptable range of 0 to 31.]], - [[ctime.days(date.mdy(0,31,1978))], [144349.00]], - [[ctime.days(date.mdy(13,31,1978))], [144745.00]], - [[ctime.days(date.mdy(10,$sysmis,1978))], [sysmis]], - [[ctime.days(date.mdy($sysmis,31,1978))], [sysmis]], - [[ctime.days(date.mdy(10,31,$sysmis))], [sysmis]], - [[ctime.days(date.mdy($sysmis,$sysmis,1978))], [sysmis]], - [[ctime.days(date.mdy($sysmis,31,$sysmis))], [sysmis]], - [[ctime.days(date.mdy(10,$sysmis,$sysmis))], [sysmis]], - [[ctime.days(date.mdy($sysmis,$sysmis,$sysmis))], [sysmis]], - [[date.mdy('a',1,2)], [error], - [error: DEBUG EVALUATE: Type mismatch invoking DATE.MDY(number, number, number) as date.mdy(string, number, number).]], - [[date.mdy(1,'a',2)], [error], - [error: DEBUG EVALUATE: Type mismatch invoking DATE.MDY(number, number, number) as date.mdy(number, string, number).]], - [[date.mdy(1,2,'a')], [error], - [error: DEBUG EVALUATE: Type mismatch invoking DATE.MDY(number, number, number) as date.mdy(number, number, string).]], - [[ctime.days(date.mdy(0,0,0))], [152353.00]], - [[ctime.days(date.mdy(0,0,999))], [sysmis], - [error: DEBUG EVALUATE: Date 0998-12-0 is before the earliest acceptable date of 1582-10-15.]], - [[date.mdy(1,1,1582)], [sysmis], - [error: DEBUG EVALUATE: Date 1582-1-1 is before the earliest acceptable date of 1582-10-15.]], - [[date.mdy(10,14,1582)], [sysmis], - [error: DEBUG EVALUATE: Date 1582-10-14 is before the earliest acceptable date of 1582-10-15.]], - [[date.mdy(10,15,1582)], [86400.00]], - - [[ctime.days(date.moyr(1,2000))], [152385.00]], - [[ctime.days(date.moyr(2,2000))], [152416.00]], - [[ctime.days(date.moyr(3,2000))], [152445.00]], - [[ctime.days(date.moyr(4,2000))], [152476.00]], - [[ctime.days(date.moyr(5,2000))], [152506.00]], - [[ctime.days(date.moyr(13,2000))], [152751.00]], - [[ctime.days(date.moyr(14,2000))], [sysmis], - [error: DEBUG EVALUATE: Month 14 is not in acceptable range of 0 to 13.]], - [[ctime.days(date.moyr($sysmis,2000))], [sysmis]], - [[ctime.days(date.moyr(1,$sysmis))], [sysmis]], - [[ctime.days(date.moyr($sysmis,$sysmis))], [sysmis]], - [[date.moyr('a',2000)], [error], - [error: DEBUG EVALUATE: Type mismatch invoking DATE.MOYR(number, number) as date.moyr(string, number).]], - [[date.moyr(5,'a')], [error], - [error: DEBUG EVALUATE: Type mismatch invoking DATE.MOYR(number, number) as date.moyr(number, string).]], - [[date.moyr('a','b')], [error], - [error: DEBUG EVALUATE: Type mismatch invoking DATE.MOYR(number, number) as date.moyr(string, string).]], - - [[ctime.days(date.qyr(1,2000))], [152385.00]], - [[ctime.days(date.qyr(2,2000))], [152476.00]], - [[ctime.days(date.qyr(5,2000))], [sysmis], - [warning: DEBUG EVALUATE: The first argument to DATE.QYR must be 1, 2, 3, or 4.]], - [[ctime.days(date.qyr(6,2000))], [sysmis], - [warning: DEBUG EVALUATE: The first argument to DATE.QYR must be 1, 2, 3, or 4.]], - [[ctime.days(date.qyr($sysmis,2000))], [sysmis]], - [[ctime.days(date.qyr(1,$sysmis))], [sysmis]], - [[ctime.days(date.qyr($sysmis,$sysmis))], [sysmis]], - [[date.qyr('a',2000)], [error], - [error: DEBUG EVALUATE: Type mismatch invoking DATE.QYR(number, number) as date.qyr(string, number).]], - [[date.qyr(5,'a')], [error], - [error: DEBUG EVALUATE: Type mismatch invoking DATE.QYR(number, number) as date.qyr(number, string).]], - [[date.qyr('a','b')], [error], - [error: DEBUG EVALUATE: Type mismatch invoking DATE.QYR(number, number) as date.qyr(string, string).]], - - [[ctime.days(date.wkyr(1,2000))], [152385.00]], - [[ctime.days(date.wkyr(15,1999))], [152118.00]], - [[ctime.days(date.wkyr(36,1999))], [152265.00]], - [[ctime.days(date.wkyr(54,1999))], [sysmis], - [error: DEBUG EVALUATE: The week argument to DATE.WKYR is outside the acceptable range of 1 to 53. The result will be system-missing.]], - [[ctime.days(date.wkyr($sysmis,1999))], [sysmis]], - [[ctime.days(date.wkyr(1,$sysmis))], [sysmis]], - [[ctime.days(date.wkyr($sysmis,$sysmis))], [sysmis]], - [[date.wkyr('a',1999)], [error], - [error: DEBUG EVALUATE: Type mismatch invoking DATE.WKYR(number, number) as date.wkyr(string, number).]], - [[date.wkyr(5,'a')], [error], - [error: DEBUG EVALUATE: Type mismatch invoking DATE.WKYR(number, number) as date.wkyr(number, string).]], - [[date.wkyr('a','b')], [error], - [error: DEBUG EVALUATE: Type mismatch invoking DATE.WKYR(number, number) as date.wkyr(string, string).]], - - [[ctime.days(date.yrday(2000,1))], [152385.00]], - [[ctime.days(date.yrday(2000,100))], [152484.00]], - [[ctime.days(date.yrday(2000,253))], [152637.00]], - [[ctime.days(date.yrday(2000,500))], [sysmis], - [error: DEBUG EVALUATE: The day argument to DATE.YRDAY is outside the acceptable range of 1 to 366. The result will be system-missing.]], - [[ctime.days(date.yrday(2000,-100))], [sysmis], - [error: DEBUG EVALUATE: The day argument to DATE.YRDAY is outside the acceptable range of 1 to 366. The result will be system-missing.]], - [[ctime.days(date.yrday(1999,$sysmis))], [sysmis]], - [[ctime.days(date.yrday($sysmis,1))], [sysmis]], - [[ctime.days(date.yrday($sysmis,$sysmis))], [sysmis]], - [[date.yrday(1999,'a')], [error], - [error: DEBUG EVALUATE: Type mismatch invoking DATE.YRDAY(number, number) as date.yrday(number, string).]], - [[date.yrday('a',5)], [error], - [error: DEBUG EVALUATE: Type mismatch invoking DATE.YRDAY(number, number) as date.yrday(string, number).]], - [[date.yrday('a','b')], [error], - [error: DEBUG EVALUATE: Type mismatch invoking DATE.YRDAY(number, number) as date.yrday(string, string).]]) - -CHECK_EXPR_EVAL([xdate], - [[xdate.date(date.mdy(6,10,1648) + time.hms(0,0,0)) / 86400], [23981.00]], - [[xdate.date(date.mdy(6,30,1680) + time.hms(4,50,38)) / 86400], [35689.00]], - [[xdate.date(date.mdy(7,24,1716) + time.hms(12,31,35)) / 86400], [48861.00]], - [[xdate.date(date.mdy(6,19,1768) + time.hms(12,47,53)) / 86400], [67819.00]], - [[xdate.date(date.mdy(8,2,1819) + time.hms(1,26,0)) / 86400], [86489.00]], - [[xdate.date(date.mdy(3,27,1839) + time.hms(20,58,11)) / 86400], [93666.00]], - [[xdate.date(date.mdy(4,19,1903) + time.hms(7,36,5)) / 86400], [117064.00]], - [[xdate.date(date.mdy(8,25,1929) + time.hms(15,43,49)) / 86400], [126689.00]], - [[xdate.date(date.mdy(9,29,1941) + time.hms(4,25,9)) / 86400], [131107.00]], - [[xdate.date(date.mdy(4,19,1943) + time.hms(6,49,27)) / 86400], [131674.00]], - [[xdate.date(date.mdy(10,7,1943) + time.hms(2,57,52)) / 86400], [131845.00]], - [[xdate.date(date.mdy(3,17,1992) + time.hms(16,45,44)) / 86400], [149539.00]], - [[xdate.date(date.mdy(2,25,1996) + time.hms(21,30,57)) / 86400], [150979.00]], - [[xdate.date(date.mdy(9,29,1941) + time.hms(4,25,9)) / 86400], [131107.00]], - [[xdate.date(date.mdy(4,19,43) + time.hms(6,49,27)) / 86400], [131674.00]], - [[xdate.date(date.mdy(10,7,43) + time.hms(2,57,52)) / 86400], [131845.00]], - [[xdate.date(date.mdy(3,17,92) + time.hms(16,45,44)) / 86400], [149539.00]], - [[xdate.date(date.mdy(2,25,96) + time.hms(21,30,57)) / 86400], [150979.00]], - [[xdate.date(date.mdy(11,10,2038) + time.hms(22,30,4)) / 86400], [166578.00]], - [[xdate.date(date.mdy(7,18,2094) + time.hms(1,56,51)) / 86400], [186917.00]], - [[xdate.date(123.4)], [0.00]], - [[xdate.date('')], [error], - [error: DEBUG EVALUATE: Type mismatch invoking XDATE.DATE(number) as xdate.date(string).]], - - [[xdate.hour(date.mdy(6,10,1648) + time.hms(0,0,0))], [0.00]], - [[xdate.hour(date.mdy(6,30,1680) + time.hms(4,50,38))], [4.00]], - [[xdate.hour(date.mdy(7,24,1716) + time.hms(12,31,35))], [12.00]], - [[xdate.hour(date.mdy(6,19,1768) + time.hms(12,47,53))], [12.00]], - [[xdate.hour(date.mdy(8,2,1819) + time.hms(1,26,0))], [1.00]], - [[xdate.hour(date.mdy(3,27,1839) + time.hms(20,58,11))], [20.00]], - [[xdate.hour(date.mdy(4,19,1903) + time.hms(7,36,5))], [7.00]], - [[xdate.hour(date.mdy(8,25,1929) + time.hms(15,43,49))], [15.00]], - [[xdate.hour(date.mdy(9,29,1941) + time.hms(4,25,9))], [4.00]], - [[xdate.hour(date.mdy(4,19,1943) + time.hms(6,49,27))], [6.00]], - [[xdate.hour(date.mdy(10,7,1943) + time.hms(2,57,52))], [2.00]], - [[xdate.hour(date.mdy(3,17,1992) + time.hms(16,45,44))], [16.00]], - [[xdate.hour(date.mdy(2,25,1996) + time.hms(21,30,57))], [21.00]], - [[xdate.hour(date.mdy(9,29,1941) + time.hms(4,25,9))], [4.00]], - [[xdate.hour(date.mdy(4,19,43) + time.hms(6,49,27))], [6.00]], - [[xdate.hour(date.mdy(10,7,43) + time.hms(2,57,52))], [2.00]], - [[xdate.hour(date.mdy(3,17,92) + time.hms(16,45,44))], [16.00]], - [[xdate.hour(date.mdy(2,25,96) + time.hms(21,30,57))], [21.00]], - [[xdate.hour(date.mdy(11,10,2038) + time.hms(22,30,4))], [22.00]], - [[xdate.hour(date.mdy(7,18,2094) + time.hms(1,56,51))], [1.00]], - [[xdate.hour(-1)], [-1.00]], - [[xdate.hour(1)], [0.00]], - [[xdate.hour($sysmis)], [sysmis]], - [[xdate.hour('')], [error], - [error: DEBUG EVALUATE: Type mismatch invoking XDATE.HOUR(number) as xdate.hour(string).]], - - [[xdate.jday(date.mdy(6,10,1648) + time.hms(0,0,0))], [162.00]], - [[xdate.jday(date.mdy(6,30,1680) + time.hms(4,50,38))], [182.00]], - [[xdate.jday(date.mdy(7,24,1716) + time.hms(12,31,35))], [206.00]], - [[xdate.jday(date.mdy(6,19,1768) + time.hms(12,47,53))], [171.00]], - [[xdate.jday(date.mdy(8,2,1819) + time.hms(1,26,0))], [214.00]], - [[xdate.jday(date.mdy(3,27,1839) + time.hms(20,58,11))], [86.00]], - [[xdate.jday(date.mdy(4,19,1903) + time.hms(7,36,5))], [109.00]], - [[xdate.jday(date.mdy(8,25,1929) + time.hms(15,43,49))], [237.00]], - [[xdate.jday(date.mdy(9,29,1941) + time.hms(4,25,9))], [272.00]], - [[xdate.jday(date.mdy(4,19,1943) + time.hms(6,49,27))], [109.00]], - [[xdate.jday(date.mdy(10,7,1943) + time.hms(2,57,52))], [280.00]], - [[xdate.jday(date.mdy(3,17,1992) + time.hms(16,45,44))], [77.00]], - [[xdate.jday(date.mdy(2,25,1996) + time.hms(21,30,57))], [56.00]], - [[xdate.jday(date.mdy(9,29,1941) + time.hms(4,25,9))], [272.00]], - [[xdate.jday(date.mdy(4,19,43) + time.hms(6,49,27))], [109.00]], - [[xdate.jday(date.mdy(10,7,43) + time.hms(2,57,52))], [280.00]], - [[xdate.jday(date.mdy(3,17,92) + time.hms(16,45,44))], [77.00]], - [[xdate.jday(date.mdy(2,25,96) + time.hms(21,30,57))], [56.00]], - [[xdate.jday(date.mdy(11,10,2038) + time.hms(22,30,4))], [314.00]], - [[xdate.jday(date.mdy(7,18,2094) + time.hms(1,56,51))], [199.00]], - [[xdate.jday(0)], [sysmis]], - [[xdate.jday(1)], [sysmis]], - [[xdate.jday(86400)], [288.00]], - - [[xdate.mday(date.mdy(6,10,1648) + time.hms(0,0,0))], [10.00]], - [[xdate.mday(date.mdy(6,30,1680) + time.hms(4,50,38))], [30.00]], - [[xdate.mday(date.mdy(7,24,1716) + time.hms(12,31,35))], [24.00]], - [[xdate.mday(date.mdy(6,19,1768) + time.hms(12,47,53))], [19.00]], - [[xdate.mday(date.mdy(8,2,1819) + time.hms(1,26,0))], [2.00]], - [[xdate.mday(date.mdy(3,27,1839) + time.hms(20,58,11))], [27.00]], - [[xdate.mday(date.mdy(4,19,1903) + time.hms(7,36,5))], [19.00]], - [[xdate.mday(date.mdy(8,25,1929) + time.hms(15,43,49))], [25.00]], - [[xdate.mday(date.mdy(9,29,1941) + time.hms(4,25,9))], [29.00]], - [[xdate.mday(date.mdy(4,19,1943) + time.hms(6,49,27))], [19.00]], - [[xdate.mday(date.mdy(10,7,1943) + time.hms(2,57,52))], [7.00]], - [[xdate.mday(date.mdy(3,17,1992) + time.hms(16,45,44))], [17.00]], - [[xdate.mday(date.mdy(2,25,1996) + time.hms(21,30,57))], [25.00]], - [[xdate.mday(date.mdy(9,29,1941) + time.hms(4,25,9))], [29.00]], - [[xdate.mday(date.mdy(4,19,43) + time.hms(6,49,27))], [19.00]], - [[xdate.mday(date.mdy(10,7,43) + time.hms(2,57,52))], [7.00]], - [[xdate.mday(date.mdy(3,17,92) + time.hms(16,45,44))], [17.00]], - [[xdate.mday(date.mdy(2,25,96) + time.hms(21,30,57))], [25.00]], - [[xdate.mday(date.mdy(11,10,2038) + time.hms(22,30,4))], [10.00]], - [[xdate.mday(date.mdy(7,18,2094) + time.hms(1,56,51))], [18.00]], - - [[xdate.minute(date.mdy(6,10,1648) + time.hms(0,0,0))], [0.00]], - [[xdate.minute(date.mdy(6,30,1680) + time.hms(4,50,38))], [50.00]], - [[xdate.minute(date.mdy(7,24,1716) + time.hms(12,31,35))], [31.00]], - [[xdate.minute(date.mdy(6,19,1768) + time.hms(12,47,53))], [47.00]], - [[xdate.minute(date.mdy(8,2,1819) + time.hms(1,26,0))], [26.00]], - [[xdate.minute(date.mdy(3,27,1839) + time.hms(20,58,11))], [58.00]], - [[xdate.minute(date.mdy(4,19,1903) + time.hms(7,36,5))], [36.00]], - [[xdate.minute(date.mdy(8,25,1929) + time.hms(15,43,49))], [43.00]], - [[xdate.minute(date.mdy(9,29,1941) + time.hms(4,25,9))], [25.00]], - [[xdate.minute(date.mdy(4,19,1943) + time.hms(6,49,27))], [49.00]], - [[xdate.minute(date.mdy(10,7,1943) + time.hms(2,57,52))], [57.00]], - [[xdate.minute(date.mdy(3,17,1992) + time.hms(16,45,44))], [45.00]], - [[xdate.minute(date.mdy(2,25,1996) + time.hms(21,30,57))], [30.00]], - [[xdate.minute(date.mdy(9,29,1941) + time.hms(4,25,9))], [25.00]], - [[xdate.minute(date.mdy(4,19,43) + time.hms(6,49,27))], [49.00]], - [[xdate.minute(date.mdy(10,7,43) + time.hms(2,57,52))], [57.00]], - [[xdate.minute(date.mdy(3,17,92) + time.hms(16,45,44))], [45.00]], - [[xdate.minute(date.mdy(2,25,96) + time.hms(21,30,57))], [30.00]], - [[xdate.minute(date.mdy(11,10,2038) + time.hms(22,30,4))], [30.00]], - [[xdate.minute(date.mdy(7,18,2094) + time.hms(1,56,51))], [56.00]], - - [[xdate.month(date.mdy(6,10,1648) + time.hms(0,0,0))], [6.00]], - [[xdate.month(date.mdy(6,30,1680) + time.hms(4,50,38))], [6.00]], - [[xdate.month(date.mdy(7,24,1716) + time.hms(12,31,35))], [7.00]], - [[xdate.month(date.mdy(6,19,1768) + time.hms(12,47,53))], [6.00]], - [[xdate.month(date.mdy(8,2,1819) + time.hms(1,26,0))], [8.00]], - [[xdate.month(date.mdy(3,27,1839) + time.hms(20,58,11))], [3.00]], - [[xdate.month(date.mdy(4,19,1903) + time.hms(7,36,5))], [4.00]], - [[xdate.month(date.mdy(8,25,1929) + time.hms(15,43,49))], [8.00]], - [[xdate.month(date.mdy(9,29,1941) + time.hms(4,25,9))], [9.00]], - [[xdate.month(date.mdy(4,19,1943) + time.hms(6,49,27))], [4.00]], - [[xdate.month(date.mdy(10,7,1943) + time.hms(2,57,52))], [10.00]], - [[xdate.month(date.mdy(3,17,1992) + time.hms(16,45,44))], [3.00]], - [[xdate.month(date.mdy(2,25,1996) + time.hms(21,30,57))], [2.00]], - [[xdate.month(date.mdy(9,29,1941) + time.hms(4,25,9))], [9.00]], - [[xdate.month(date.mdy(4,19,43) + time.hms(6,49,27))], [4.00]], - [[xdate.month(date.mdy(10,7,43) + time.hms(2,57,52))], [10.00]], - [[xdate.month(date.mdy(3,17,92) + time.hms(16,45,44))], [3.00]], - [[xdate.month(date.mdy(2,25,96) + time.hms(21,30,57))], [2.00]], - [[xdate.month(date.mdy(11,10,2038) + time.hms(22,30,4))], [11.00]], - [[xdate.month(date.mdy(7,18,2094) + time.hms(1,56,51))], [7.00]], - - [[xdate.quarter(date.mdy(6,10,1648) + time.hms(0,0,0))], [2.00]], - [[xdate.quarter(date.mdy(6,30,1680) + time.hms(4,50,38))], [2.00]], - [[xdate.quarter(date.mdy(7,24,1716) + time.hms(12,31,35))], [3.00]], - [[xdate.quarter(date.mdy(6,19,1768) + time.hms(12,47,53))], [2.00]], - [[xdate.quarter(date.mdy(8,2,1819) + time.hms(1,26,0))], [3.00]], - [[xdate.quarter(date.mdy(3,27,1839) + time.hms(20,58,11))], [1.00]], - [[xdate.quarter(date.mdy(4,19,1903) + time.hms(7,36,5))], [2.00]], - [[xdate.quarter(date.mdy(8,25,1929) + time.hms(15,43,49))], [3.00]], - [[xdate.quarter(date.mdy(9,29,1941) + time.hms(4,25,9))], [3.00]], - [[xdate.quarter(date.mdy(4,19,1943) + time.hms(6,49,27))], [2.00]], - [[xdate.quarter(date.mdy(10,7,1943) + time.hms(2,57,52))], [4.00]], - [[xdate.quarter(date.mdy(3,17,1992) + time.hms(16,45,44))], [1.00]], - [[xdate.quarter(date.mdy(2,25,1996) + time.hms(21,30,57))], [1.00]], - [[xdate.quarter(date.mdy(9,29,1941) + time.hms(4,25,9))], [3.00]], - [[xdate.quarter(date.mdy(4,19,43) + time.hms(6,49,27))], [2.00]], - [[xdate.quarter(date.mdy(10,7,43) + time.hms(2,57,52))], [4.00]], - [[xdate.quarter(date.mdy(3,17,92) + time.hms(16,45,44))], [1.00]], - [[xdate.quarter(date.mdy(2,25,96) + time.hms(21,30,57))], [1.00]], - [[xdate.quarter(date.mdy(11,10,2038) + time.hms(22,30,4))], [4.00]], - [[xdate.quarter(date.mdy(7,18,2094) + time.hms(1,56,51))], [3.00]], - - [[xdate.second(date.mdy(6,10,1648) + time.hms(0,0,0))], [0.00]], - [[xdate.second(date.mdy(6,30,1680) + time.hms(4,50,38))], [38.00]], - [[xdate.second(date.mdy(7,24,1716) + time.hms(12,31,35))], [35.00]], - [[xdate.second(date.mdy(6,19,1768) + time.hms(12,47,53))], [53.00]], - [[xdate.second(date.mdy(8,2,1819) + time.hms(1,26,0))], [0.00]], - [[xdate.second(date.mdy(3,27,1839) + time.hms(20,58,11))], [11.00]], - [[xdate.second(date.mdy(4,19,1903) + time.hms(7,36,5))], [5.00]], - [[xdate.second(date.mdy(8,25,1929) + time.hms(15,43,49))], [49.00]], - [[xdate.second(date.mdy(9,29,1941) + time.hms(4,25,9))], [9.00]], - [[xdate.second(date.mdy(4,19,1943) + time.hms(6,49,27))], [27.00]], - [[xdate.second(date.mdy(10,7,1943) + time.hms(2,57,52))], [52.00]], - [[xdate.second(date.mdy(3,17,1992) + time.hms(16,45,44))], [44.00]], - [[xdate.second(date.mdy(2,25,1996) + time.hms(21,30,57))], [57.00]], - [[xdate.second(date.mdy(9,29,1941) + time.hms(4,25,9))], [9.00]], - [[xdate.second(date.mdy(4,19,43) + time.hms(6,49,27))], [27.00]], - [[xdate.second(date.mdy(10,7,43) + time.hms(2,57,52))], [52.00]], - [[xdate.second(date.mdy(3,17,92) + time.hms(16,45,44))], [44.00]], - [[xdate.second(date.mdy(2,25,96) + time.hms(21,30,57))], [57.00]], - [[xdate.second(date.mdy(11,10,2038) + time.hms(22,30,4))], [4.00]], - [[xdate.second(date.mdy(7,18,2094) + time.hms(1,56,51))], [51.00]], - - [[xdate.tday(date.mdy(6,10,1648) + time.hms(0,0,0))], [23981.00]], - [[xdate.tday(date.mdy(6,30,1680) + time.hms(4,50,38))], [35689.00]], - [[xdate.tday(date.mdy(7,24,1716) + time.hms(12,31,35))], [48861.00]], - [[xdate.tday(date.mdy(6,19,1768) + time.hms(12,47,53))], [67819.00]], - [[xdate.tday(date.mdy(8,2,1819) + time.hms(1,26,0))], [86489.00]], - [[xdate.tday(date.mdy(3,27,1839) + time.hms(20,58,11))], [93666.00]], - [[xdate.tday(date.mdy(4,19,1903) + time.hms(7,36,5))], [117064.00]], - [[xdate.tday(date.mdy(8,25,1929) + time.hms(15,43,49))], [126689.00]], - [[xdate.tday(date.mdy(9,29,1941) + time.hms(4,25,9))], [131107.00]], - [[xdate.tday(date.mdy(4,19,1943) + time.hms(6,49,27))], [131674.00]], - [[xdate.tday(date.mdy(10,7,1943) + time.hms(2,57,52))], [131845.00]], - [[xdate.tday(date.mdy(3,17,1992) + time.hms(16,45,44))], [149539.00]], - [[xdate.tday(date.mdy(2,25,1996) + time.hms(21,30,57))], [150979.00]], - [[xdate.tday(date.mdy(9,29,1941) + time.hms(4,25,9))], [131107.00]], - [[xdate.tday(date.mdy(4,19,43) + time.hms(6,49,27))], [131674.00]], - [[xdate.tday(date.mdy(10,7,43) + time.hms(2,57,52))], [131845.00]], - [[xdate.tday(date.mdy(3,17,92) + time.hms(16,45,44))], [149539.00]], - [[xdate.tday(date.mdy(2,25,96) + time.hms(21,30,57))], [150979.00]], - [[xdate.tday(date.mdy(11,10,2038) + time.hms(22,30,4))], [166578.00]], - [[xdate.tday(date.mdy(7,18,2094) + time.hms(1,56,51))], [186917.00]], - - [[xdate.time(date.mdy(6,10,1648) + time.hms(0,0,0))], [0.00]], - [[xdate.time(date.mdy(6,30,1680) + time.hms(4,50,38))], [17438.00]], - [[xdate.time(date.mdy(7,24,1716) + time.hms(12,31,35))], [45095.00]], - [[xdate.time(date.mdy(6,19,1768) + time.hms(12,47,53))], [46073.00]], - [[xdate.time(date.mdy(8,2,1819) + time.hms(1,26,0))], [5160.00]], - [[xdate.time(date.mdy(3,27,1839) + time.hms(20,58,11))], [75491.00]], - [[xdate.time(date.mdy(4,19,1903) + time.hms(7,36,5))], [27365.00]], - [[xdate.time(date.mdy(8,25,1929) + time.hms(15,43,49))], [56629.00]], - [[xdate.time(date.mdy(9,29,1941) + time.hms(4,25,9))], [15909.00]], - [[xdate.time(date.mdy(4,19,1943) + time.hms(6,49,27))], [24567.00]], - [[xdate.time(date.mdy(10,7,1943) + time.hms(2,57,52))], [10672.00]], - [[xdate.time(date.mdy(3,17,1992) + time.hms(16,45,44))], [60344.00]], - [[xdate.time(date.mdy(2,25,1996) + time.hms(21,30,57))], [77457.00]], - [[xdate.time(date.mdy(9,29,1941) + time.hms(4,25,9))], [15909.00]], - [[xdate.time(date.mdy(4,19,43) + time.hms(6,49,27))], [24567.00]], - [[xdate.time(date.mdy(10,7,43) + time.hms(2,57,52))], [10672.00]], - [[xdate.time(date.mdy(3,17,92) + time.hms(16,45,44))], [60344.00]], - [[xdate.time(date.mdy(2,25,96) + time.hms(21,30,57))], [77457.00]], - [[xdate.time(date.mdy(11,10,2038) + time.hms(22,30,4))], [81004.00]], - [[xdate.time(date.mdy(7,18,2094) + time.hms(1,56,51))], [7011.00]], - - [[xdate.week(date.mdy(6,10,1648) + time.hms(0,0,0))], [24.00]], - [[xdate.week(date.mdy(6,30,1680) + time.hms(4,50,38))], [26.00]], - [[xdate.week(date.mdy(7,24,1716) + time.hms(12,31,35))], [30.00]], - [[xdate.week(date.mdy(6,19,1768) + time.hms(12,47,53))], [25.00]], - [[xdate.week(date.mdy(8,2,1819) + time.hms(1,26,0))], [31.00]], - [[xdate.week(date.mdy(3,27,1839) + time.hms(20,58,11))], [13.00]], - [[xdate.week(date.mdy(4,19,1903) + time.hms(7,36,5))], [16.00]], - [[xdate.week(date.mdy(8,25,1929) + time.hms(15,43,49))], [34.00]], - [[xdate.week(date.mdy(9,29,1941) + time.hms(4,25,9))], [39.00]], - [[xdate.week(date.mdy(4,19,1943) + time.hms(6,49,27))], [16.00]], - [[xdate.week(date.mdy(10,7,1943) + time.hms(2,57,52))], [40.00]], - [[xdate.week(date.mdy(3,17,1992) + time.hms(16,45,44))], [11.00]], - [[xdate.week(date.mdy(2,25,1996) + time.hms(21,30,57))], [8.00]], - [[xdate.week(date.mdy(9,29,1941) + time.hms(4,25,9))], [39.00]], - [[xdate.week(date.mdy(4,19,43) + time.hms(6,49,27))], [16.00]], - [[xdate.week(date.mdy(10,7,43) + time.hms(2,57,52))], [40.00]], - [[xdate.week(date.mdy(3,17,92) + time.hms(16,45,44))], [11.00]], - [[xdate.week(date.mdy(2,25,96) + time.hms(21,30,57))], [8.00]], - [[xdate.week(date.mdy(11,10,2038) + time.hms(22,30,4))], [45.00]], - [[xdate.week(date.mdy(7,18,2094) + time.hms(1,56,51))], [29.00]], - - [[xdate.wkday(date.mdy(6,10,1648))], [4.00]], - [[xdate.wkday(date.mdy(6,30,1680))], [1.00]], - [[xdate.wkday(date.mdy(7,24,1716))], [6.00]], - [[xdate.wkday(date.mdy(6,19,1768))], [1.00]], - [[xdate.wkday(date.mdy(8,2,1819))], [2.00]], - [[xdate.wkday(date.mdy(3,27,1839))], [4.00]], - [[xdate.wkday(date.mdy(4,19,1903))], [1.00]], - [[xdate.wkday(date.mdy(8,25,1929))], [1.00]], - [[xdate.wkday(date.mdy(9,29,1941))], [2.00]], - [[xdate.wkday(date.mdy(4,19,1943))], [2.00]], - [[xdate.wkday(date.mdy(10,7,1943))], [5.00]], - [[xdate.wkday(date.mdy(3,17,1992))], [3.00]], - [[xdate.wkday(date.mdy(2,25,1996))], [1.00]], - [[xdate.wkday(date.mdy(9,29,1941))], [2.00]], - [[xdate.wkday(date.mdy(4,19,43))], [2.00]], - [[xdate.wkday(date.mdy(10,7,43))], [5.00]], - [[xdate.wkday(date.mdy(3,17,92))], [3.00]], - [[xdate.wkday(date.mdy(2,25,96))], [1.00]], - [[xdate.wkday(date.mdy(11,10,2038))], [4.00]], - [[xdate.wkday(date.mdy(7,18,2094))], [1.00]], - - [[xdate.year(date.mdy(6,10,1648) + time.hms(0,0,0))], [1648.00]], - [[xdate.year(date.mdy(6,30,1680) + time.hms(4,50,38))], [1680.00]], - [[xdate.year(date.mdy(7,24,1716) + time.hms(12,31,35))], [1716.00]], - [[xdate.year(date.mdy(6,19,1768) + time.hms(12,47,53))], [1768.00]], - [[xdate.year(date.mdy(8,2,1819) + time.hms(1,26,0))], [1819.00]], - [[xdate.year(date.mdy(3,27,1839) + time.hms(20,58,11))], [1839.00]], - [[xdate.year(date.mdy(4,19,1903) + time.hms(7,36,5))], [1903.00]], - [[xdate.year(date.mdy(8,25,1929) + time.hms(15,43,49))], [1929.00]], - [[xdate.year(date.mdy(9,29,1941) + time.hms(4,25,9))], [1941.00]], - [[xdate.year(date.mdy(4,19,1943) + time.hms(6,49,27))], [1943.00]], - [[xdate.year(date.mdy(10,7,1943) + time.hms(2,57,52))], [1943.00]], - [[xdate.year(date.mdy(3,17,1992) + time.hms(16,45,44))], [1992.00]], - [[xdate.year(date.mdy(2,25,1996) + time.hms(21,30,57))], [1996.00]], - [[xdate.year(date.mdy(9,29,1941) + time.hms(4,25,9))], [1941.00]], - [[xdate.year(date.mdy(4,19,43) + time.hms(6,49,27))], [1943.00]], - [[xdate.year(date.mdy(10,7,43) + time.hms(2,57,52))], [1943.00]], - [[xdate.year(date.mdy(3,17,92) + time.hms(16,45,44))], [1992.00]], - [[xdate.year(date.mdy(2,25,96) + time.hms(21,30,57))], [1996.00]], - [[xdate.year(date.mdy(11,10,2038) + time.hms(22,30,4))], [2038.00]], - [[xdate.year(date.mdy(7,18,2094) + time.hms(1,56,51))], [2094.00]]) - -CHECK_EXPR_EVAL([datediff], - [[datediff(date.mdy(6,10,1648), date.mdy(6,30,1680), 'years')], [-32.00]], - [[datediff(date.mdy(6,30,1680), date.mdy(7,24,1716), 'years')], [-36.00]], - [[datediff(date.mdy(7,24,1716), date.mdy(6,19,1768), 'years')], [-51.00]], - [[datediff(date.mdy(6,19,1768), date.mdy(8,2,1819), 'years')], [-51.00]], - [[datediff(date.mdy(8,2,1819), date.mdy(3,27,1839), 'years')], [-19.00]], - [[datediff(date.mdy(3,27,1839), date.mdy(4,19,1903), 'years')], [-64.00]], - [[datediff(date.mdy(4,19,1903), date.mdy(8,25,1929), 'years')], [-26.00]], - [[datediff(date.mdy(8,25,1929), date.mdy(9,29,1941), 'years')], [-12.00]], - [[datediff(date.mdy(9,29,1941), date.mdy(4,19,1943), 'years')], [-1.00]], - [[datediff(date.mdy(4,19,1943), date.mdy(10,7,1943), 'years')], [0.00]], - [[datediff(date.mdy(10,7,1943), date.mdy(3,17,1992), 'years')], [-48.00]], - [[datediff(date.mdy(3,17,1992), date.mdy(2,25,1996), 'years')], [-3.00]], - [[datediff(date.mdy(9,29,1941), date.mdy(2,25,1996), 'years')], [-54.00]], - [[datediff(date.mdy(9,29,1941), date.mdy(4,19,43), 'years')], [-1.00]], - [[datediff(date.mdy(4,19,43), date.mdy(10,7,43), 'years')], [0.00]], - [[datediff(date.mdy(10,7,43), date.mdy(3,17,92), 'years')], [-48.00]], - [[datediff(date.mdy(3,17,92), date.mdy(2,25,96), 'years')], [-3.00]], - [[datediff(date.mdy(2,25,96), date.mdy(11,10,2038), 'years')], [-42.00]], - [[datediff(date.mdy(11,10,2038), date.mdy(7,18,2094), 'years')], [-55.00]], - [[datediff(date.mdy(2,29,1900), date.mdy(2,29,1904), 'years')], [-3.00]], - [[datediff(date.mdy(2,29,1904), date.mdy(2,29,1908), 'years')], [-4.00]], - [[datediff(date.mdy(2,29,1900), date.mdy(2,28,1903), 'years')], [-2.00]], - - [[datediff(date.mdy(6,10,1648), date.mdy(6,30,1680), 'quarters')], [-128.00]], - [[datediff(date.mdy(6,30,1680), date.mdy(7,24,1716), 'quarters')], [-144.00]], - [[datediff(date.mdy(7,24,1716), date.mdy(6,19,1768), 'quarters')], [-207.00]], - [[datediff(date.mdy(6,19,1768), date.mdy(8,2,1819), 'quarters')], [-204.00]], - [[datediff(date.mdy(8,2,1819), date.mdy(3,27,1839), 'quarters')], [-78.00]], - [[datediff(date.mdy(3,27,1839), date.mdy(4,19,1903), 'quarters')], [-256.00]], - [[datediff(date.mdy(4,19,1903), date.mdy(8,25,1929), 'quarters')], [-105.00]], - [[datediff(date.mdy(8,25,1929), date.mdy(9,29,1941), 'quarters')], [-48.00]], - [[datediff(date.mdy(9,29,1941), date.mdy(4,19,1943), 'quarters')], [-6.00]], - [[datediff(date.mdy(4,19,1943), date.mdy(10,7,1943), 'quarters')], [-1.00]], - [[datediff(date.mdy(10,7,1943), date.mdy(3,17,1992), 'quarters')], [-193.00]], - [[datediff(date.mdy(3,17,1992), date.mdy(2,25,1996), 'quarters')], [-15.00]], - [[datediff(date.mdy(9,29,1941), date.mdy(2,25,1996), 'quarters')], [-217.00]], - [[datediff(date.mdy(9,29,1941), date.mdy(4,19,43), 'quarters')], [-6.00]], - [[datediff(date.mdy(4,19,43), date.mdy(10,7,43), 'quarters')], [-1.00]], - [[datediff(date.mdy(10,7,43), date.mdy(3,17,92), 'quarters')], [-193.00]], - [[datediff(date.mdy(3,17,92), date.mdy(2,25,96), 'quarters')], [-15.00]], - [[datediff(date.mdy(2,25,96), date.mdy(11,10,2038), 'quarters')], [-170.00]], - [[datediff(date.mdy(11,10,2038), date.mdy(7,18,2094), 'quarters')], [-222.00]], - [[datediff(date.mdy(2,29,1900), date.mdy(2,29,1904), 'quarters')], [-15.00]], - [[datediff(date.mdy(2,29,1904), date.mdy(2,29,1908), 'quarters')], [-16.00]], - [[datediff(date.mdy(2,29,1900), date.mdy(2,28,1903), 'quarters')], [-11.00]], - - [[datediff(date.mdy(6,10,1648), date.mdy(6,30,1680), 'months')], [-384.00]], - [[datediff(date.mdy(6,30,1680), date.mdy(7,24,1716), 'months')], [-432.00]], - [[datediff(date.mdy(7,24,1716), date.mdy(6,19,1768), 'months')], [-622.00]], - [[datediff(date.mdy(6,19,1768), date.mdy(8,2,1819), 'months')], [-613.00]], - [[datediff(date.mdy(8,2,1819), date.mdy(3,27,1839), 'months')], [-235.00]], - [[datediff(date.mdy(3,27,1839), date.mdy(4,19,1903), 'months')], [-768.00]], - [[datediff(date.mdy(4,19,1903), date.mdy(8,25,1929), 'months')], [-316.00]], - [[datediff(date.mdy(8,25,1929), date.mdy(9,29,1941), 'months')], [-145.00]], - [[datediff(date.mdy(9,29,1941), date.mdy(4,19,1943), 'months')], [-18.00]], - [[datediff(date.mdy(4,19,1943), date.mdy(10,7,1943), 'months')], [-5.00]], - [[datediff(date.mdy(10,7,1943), date.mdy(3,17,1992), 'months')], [-581.00]], - [[datediff(date.mdy(3,17,1992), date.mdy(2,25,1996), 'months')], [-47.00]], - [[datediff(date.mdy(9,29,1941), date.mdy(2,25,1996), 'months')], [-652.00]], - [[datediff(date.mdy(9,29,1941), date.mdy(4,19,43), 'months')], [-18.00]], - [[datediff(date.mdy(4,19,43), date.mdy(10,7,43), 'months')], [-5.00]], - [[datediff(date.mdy(10,7,43), date.mdy(3,17,92), 'months')], [-581.00]], - [[datediff(date.mdy(3,17,92), date.mdy(2,25,96), 'months')], [-47.00]], - [[datediff(date.mdy(2,25,96), date.mdy(11,10,2038), 'months')], [-512.00]], - [[datediff(date.mdy(11,10,2038), date.mdy(7,18,2094), 'months')], [-668.00]], - [[datediff(date.mdy(2,29,1900), date.mdy(2,29,1904), 'months')], [-47.00]], - [[datediff(date.mdy(2,29,1904), date.mdy(2,29,1908), 'months')], [-48.00]], - [[datediff(date.mdy(2,29,1900), date.mdy(2,28,1903), 'months')], [-35.00]], - - [[datediff(date.mdy(6,10,1648), date.mdy(6,30,1680), 'weeks')], [-1672.00]], - [[datediff(date.mdy(6,30,1680), date.mdy(7,24,1716), 'weeks')], [-1881.00]], - [[datediff(date.mdy(7,24,1716), date.mdy(6,19,1768), 'weeks')], [-2708.00]], - [[datediff(date.mdy(6,19,1768), date.mdy(8,2,1819), 'weeks')], [-2667.00]], - [[datediff(date.mdy(8,2,1819), date.mdy(3,27,1839), 'weeks')], [-1025.00]], - [[datediff(date.mdy(3,27,1839), date.mdy(4,19,1903), 'weeks')], [-3342.00]], - [[datediff(date.mdy(4,19,1903), date.mdy(8,25,1929), 'weeks')], [-1375.00]], - [[datediff(date.mdy(8,25,1929), date.mdy(9,29,1941), 'weeks')], [-631.00]], - [[datediff(date.mdy(9,29,1941), date.mdy(4,19,1943), 'weeks')], [-81.00]], - [[datediff(date.mdy(4,19,1943), date.mdy(10,7,1943), 'weeks')], [-24.00]], - [[datediff(date.mdy(10,7,1943), date.mdy(3,17,1992), 'weeks')], [-2527.00]], - [[datediff(date.mdy(3,17,1992), date.mdy(2,25,1996), 'weeks')], [-205.00]], - [[datediff(date.mdy(9,29,1941), date.mdy(2,25,1996), 'weeks')], [-2838.00]], - [[datediff(date.mdy(9,29,1941), date.mdy(4,19,43), 'weeks')], [-81.00]], - [[datediff(date.mdy(4,19,43), date.mdy(10,7,43), 'weeks')], [-24.00]], - [[datediff(date.mdy(10,7,43), date.mdy(3,17,92), 'weeks')], [-2527.00]], - [[datediff(date.mdy(3,17,92), date.mdy(2,25,96), 'weeks')], [-205.00]], - [[datediff(date.mdy(2,25,96), date.mdy(11,10,2038), 'weeks')], [-2228.00]], - [[datediff(date.mdy(11,10,2038), date.mdy(7,18,2094), 'weeks')], [-2905.00]], - [[datediff(date.mdy(2,29,1900), date.mdy(2,29,1904), 'weeks')], [-208.00]], - [[datediff(date.mdy(2,29,1904), date.mdy(2,29,1908), 'weeks')], [-208.00]], - [[datediff(date.mdy(2,29,1900), date.mdy(2,28,1903), 'weeks')], [-156.00]], - - [[datediff(date.mdy(6,10,1648), date.mdy(6,30,1680), 'days')], [-11708.00]], - [[datediff(date.mdy(6,30,1680), date.mdy(7,24,1716), 'days')], [-13172.00]], - [[datediff(date.mdy(7,24,1716), date.mdy(6,19,1768), 'days')], [-18958.00]], - [[datediff(date.mdy(6,19,1768), date.mdy(8,2,1819), 'days')], [-18670.00]], - [[datediff(date.mdy(8,2,1819), date.mdy(3,27,1839), 'days')], [-7177.00]], - [[datediff(date.mdy(3,27,1839), date.mdy(4,19,1903), 'days')], [-23398.00]], - [[datediff(date.mdy(4,19,1903), date.mdy(8,25,1929), 'days')], [-9625.00]], - [[datediff(date.mdy(8,25,1929), date.mdy(9,29,1941), 'days')], [-4418.00]], - [[datediff(date.mdy(9,29,1941), date.mdy(4,19,1943), 'days')], [-567.00]], - [[datediff(date.mdy(4,19,1943), date.mdy(10,7,1943), 'days')], [-171.00]], - [[datediff(date.mdy(10,7,1943), date.mdy(3,17,1992), 'days')], [-17694.00]], - [[datediff(date.mdy(3,17,1992), date.mdy(2,25,1996), 'days')], [-1440.00]], - [[datediff(date.mdy(9,29,1941), date.mdy(2,25,1996), 'days')], [-19872.00]], - [[datediff(date.mdy(9,29,1941), date.mdy(4,19,43), 'days')], [-567.00]], - [[datediff(date.mdy(4,19,43), date.mdy(10,7,43), 'days')], [-171.00]], - [[datediff(date.mdy(10,7,43), date.mdy(3,17,92), 'days')], [-17694.00]], - [[datediff(date.mdy(3,17,92), date.mdy(2,25,96), 'days')], [-1440.00]], - [[datediff(date.mdy(2,25,96), date.mdy(11,10,2038), 'days')], [-15599.00]], - [[datediff(date.mdy(11,10,2038), date.mdy(7,18,2094), 'days')], [-20339.00]], - [[datediff(date.mdy(2,29,1900), date.mdy(2,29,1904), 'days')], [-1460.00]], - [[datediff(date.mdy(2,29,1904), date.mdy(2,29,1908), 'days')], [-1461.00]], - [[datediff(date.mdy(2,29,1900), date.mdy(2,28,1903), 'days')], [-1094.00]], - - [[datediff(date.mdy(6,30,1680), date.mdy(6,10,1648), 'years')], [32.00]], - [[datediff(date.mdy(7,24,1716), date.mdy(6,30,1680), 'years')], [36.00]], - [[datediff(date.mdy(6,19,1768), date.mdy(7,24,1716), 'years')], [51.00]], - [[datediff(date.mdy(8,2,1819), date.mdy(6,19,1768), 'years')], [51.00]], - [[datediff(date.mdy(3,27,1839), date.mdy(8,2,1819), 'years')], [19.00]], - [[datediff(date.mdy(4,19,1903), date.mdy(3,27,1839), 'years')], [64.00]], - [[datediff(date.mdy(8,25,1929), date.mdy(4,19,1903), 'years')], [26.00]], - [[datediff(date.mdy(9,29,1941), date.mdy(8,25,1929), 'years')], [12.00]], - [[datediff(date.mdy(4,19,1943), date.mdy(9,29,1941), 'years')], [1.00]], - [[datediff(date.mdy(10,7,1943), date.mdy(4,19,1943), 'years')], [0.00]], - [[datediff(date.mdy(3,17,1992), date.mdy(10,7,1943), 'years')], [48.00]], - [[datediff(date.mdy(2,25,1996), date.mdy(3,17,1992), 'years')], [3.00]], - [[datediff(date.mdy(2,25,1996), date.mdy(9,29,1941), 'years')], [54.00]], - [[datediff(date.mdy(4,19,43), date.mdy(9,29,1941), 'years')], [1.00]], - [[datediff(date.mdy(10,7,43), date.mdy(4,19,43), 'years')], [0.00]], - [[datediff(date.mdy(3,17,92), date.mdy(10,7,43), 'years')], [48.00]], - [[datediff(date.mdy(2,25,96), date.mdy(3,17,92), 'years')], [3.00]], - [[datediff(date.mdy(11,10,2038), date.mdy(2,25,96), 'years')], [42.00]], - [[datediff(date.mdy(7,18,2094), date.mdy(11,10,2038), 'years')], [55.00]], - [[datediff(date.mdy(2,29,1904), date.mdy(2,29,1900), 'years')], [3.00]], - [[datediff(date.mdy(2,29,1908), date.mdy(2,29,1904), 'years')], [4.00]], - [[datediff(date.mdy(2,28,1903), date.mdy(2,29,1900), 'years')], [2.00]], - - [[datediff(date.mdy(6,30,1680), date.mdy(6,10,1648), 'months')], [384.00]], - [[datediff(date.mdy(7,24,1716), date.mdy(6,30,1680), 'months')], [432.00]], - [[datediff(date.mdy(6,19,1768), date.mdy(7,24,1716), 'months')], [622.00]], - [[datediff(date.mdy(8,2,1819), date.mdy(6,19,1768), 'months')], [613.00]], - [[datediff(date.mdy(3,27,1839), date.mdy(8,2,1819), 'months')], [235.00]], - [[datediff(date.mdy(4,19,1903), date.mdy(3,27,1839), 'months')], [768.00]], - [[datediff(date.mdy(8,25,1929), date.mdy(4,19,1903), 'months')], [316.00]], - [[datediff(date.mdy(9,29,1941), date.mdy(8,25,1929), 'months')], [145.00]], - [[datediff(date.mdy(4,19,1943), date.mdy(9,29,1941), 'months')], [18.00]], - [[datediff(date.mdy(10,7,1943), date.mdy(4,19,1943), 'months')], [5.00]], - [[datediff(date.mdy(3,17,1992), date.mdy(10,7,1943), 'months')], [581.00]], - [[datediff(date.mdy(2,25,1996), date.mdy(3,17,1992), 'months')], [47.00]], - [[datediff(date.mdy(2,25,1996), date.mdy(9,29,1941), 'months')], [652.00]], - [[datediff(date.mdy(4,19,43), date.mdy(9,29,1941), 'months')], [18.00]], - [[datediff(date.mdy(10,7,43), date.mdy(4,19,43), 'months')], [5.00]], - [[datediff(date.mdy(3,17,92), date.mdy(10,7,43), 'months')], [581.00]], - [[datediff(date.mdy(2,25,96), date.mdy(3,17,92), 'months')], [47.00]], - [[datediff(date.mdy(11,10,2038), date.mdy(2,25,96), 'months')], [512.00]], - [[datediff(date.mdy(7,18,2094), date.mdy(11,10,2038), 'months')], [668.00]], - [[datediff(date.mdy(2,29,1904), date.mdy(2,29,1900), 'months')], [47.00]], - [[datediff(date.mdy(2,29,1908), date.mdy(2,29,1904), 'months')], [48.00]], - [[datediff(date.mdy(2,28,1903), date.mdy(2,29,1900), 'months')], [35.00]], - - [[datediff(date.mdy(6,30,1680), date.mdy(6,10,1648), 'quarters')], [128.00]], - [[datediff(date.mdy(7,24,1716), date.mdy(6,30,1680), 'quarters')], [144.00]], - [[datediff(date.mdy(6,19,1768), date.mdy(7,24,1716), 'quarters')], [207.00]], - [[datediff(date.mdy(8,2,1819), date.mdy(6,19,1768), 'quarters')], [204.00]], - [[datediff(date.mdy(3,27,1839), date.mdy(8,2,1819), 'quarters')], [78.00]], - [[datediff(date.mdy(4,19,1903), date.mdy(3,27,1839), 'quarters')], [256.00]], - [[datediff(date.mdy(8,25,1929), date.mdy(4,19,1903), 'quarters')], [105.00]], - [[datediff(date.mdy(9,29,1941), date.mdy(8,25,1929), 'quarters')], [48.00]], - [[datediff(date.mdy(4,19,1943), date.mdy(9,29,1941), 'quarters')], [6.00]], - [[datediff(date.mdy(10,7,1943), date.mdy(4,19,1943), 'quarters')], [1.00]], - [[datediff(date.mdy(3,17,1992), date.mdy(10,7,1943), 'quarters')], [193.00]], - [[datediff(date.mdy(2,25,1996), date.mdy(3,17,1992), 'quarters')], [15.00]], - [[datediff(date.mdy(2,25,1996), date.mdy(9,29,1941), 'quarters')], [217.00]], - [[datediff(date.mdy(4,19,43), date.mdy(9,29,1941), 'quarters')], [6.00]], - [[datediff(date.mdy(10,7,43), date.mdy(4,19,43), 'quarters')], [1.00]], - [[datediff(date.mdy(3,17,92), date.mdy(10,7,43), 'quarters')], [193.00]], - [[datediff(date.mdy(2,25,96), date.mdy(3,17,92), 'quarters')], [15.00]], - [[datediff(date.mdy(11,10,2038), date.mdy(2,25,96), 'quarters')], [170.00]], - [[datediff(date.mdy(7,18,2094), date.mdy(11,10,2038), 'quarters')], [222.00]], - [[datediff(date.mdy(2,29,1904), date.mdy(2,29,1900), 'quarters')], [15.00]], - [[datediff(date.mdy(2,29,1908), date.mdy(2,29,1904), 'quarters')], [16.00]], - [[datediff(date.mdy(2,28,1903), date.mdy(2,29,1900), 'quarters')], [11.00]], +evaluate.sps:75.17-75.31: error: DEBUG EVALUATE: RANGE(string, string, string[, +string, string]...) must have an odd number of arguments. + 75 | DEBUG EVALUATE /range('1', '2'). + | ^~~~~~~~~~~~~~~ -dnl time of day is significant for DATEDIFF - [[datediff(date.mdy(10,15,1910) + 234, date.mdy(10,10,1910) + 123, 'days')], - [5.00]], - [[datediff(date.mdy(10,15,1910) + 123, date.mdy(10,10,1910) + 234, 'days')], - [4.00]], - [[datediff(date.mdy(10,24,1910) + 234, date.mdy(10,10,1910) + 123, 'weeks')], - [2.00]], - [[datediff(date.mdy(10,24,1910) + 123, date.mdy(10,10,1910) + 234, 'weeks')], - [1.00]], - [[datediff(date.mdy(10,10,1910) + 234, date.mdy(5,10,1910) + 123, 'months')], - [5.00]], - [[datediff(date.mdy(10,10,1910) + 123, date.mdy(5,10,1910) + 234, 'months')], - [4.00]], - [[datediff(date.mdy(5,10,1919) + 234, date.mdy(5,10,1910) + 123, 'years')], - [9.00]], - [[datediff(date.mdy(5,10,1919) + 123, date.mdy(5,10,1910) + 234, 'years')], - [8.00]], - - [[datediff(date.mdy(10,10,1910) + 123, date.mdy(10,15,1910) + 234, 'days')], - [-5.00]], - [[datediff(date.mdy(10,10,1910) + 234, date.mdy(10,15,1910) + 123, 'days')], - [-4.00]], - [[datediff(date.mdy(10,10,1910) + 123, date.mdy(10,24,1910) + 234, 'weeks')], - [-2.00]], - [[datediff(date.mdy(10,10,1910) + 234, date.mdy(10,24,1910) + 123, 'weeks')], - [-1.00]], - [[datediff(date.mdy(5,10,1910) + 123, date.mdy(10,10,1910) + 234, 'months')], - [-5.00]], - [[datediff(date.mdy(5,10,1910) + 234, date.mdy(10,10,1910) + 123, 'months')], - [-4.00]], - [[datediff(date.mdy(5,10,1910) + 123, date.mdy(5,10,1919) + 234, 'years')], - [-9.00]], - [[datediff(date.mdy(5,10,1910) + 234, date.mdy(5,10,1919) + 123, 'years')], - [-8.00]]) - -CHECK_EXPR_EVAL([datesum], -dnl DATESUM with non-leap year - [[ctime.days(datesum(date.mdy(1,31,1900), 1, 'months') - date.mdy(1,1,1900))], [58.00]], - [[ctime.days(datesum(date.mdy(1,31,1900), 2, 'months') - date.mdy(1,1,1900))], [89.00]], - [[ctime.days(datesum(date.mdy(1,31,1900), 3, 'months') - date.mdy(1,1,1900))], [119.00]], - [[ctime.days(datesum(date.mdy(1,31,1900), 4, 'months') - date.mdy(1,1,1900))], [150.00]], - [[ctime.days(datesum(date.mdy(1,31,1900), 5.4, 'months') - date.mdy(1,1,1900))], [180.00]], - [[ctime.days(datesum(date.mdy(1,31,1900), 6, 'months') - date.mdy(1,1,1900))], [211.00]], - [[ctime.days(datesum(date.mdy(1,31,1900), 7, 'months') - date.mdy(1,1,1900))], [242.00]], - [[ctime.days(datesum(date.mdy(1,31,1900), 8, 'months') - date.mdy(1,1,1900))], [272.00]], - [[ctime.days(datesum(date.mdy(1,31,1900), 9, 'months') - date.mdy(1,1,1900))], [303.00]], - [[ctime.days(datesum(date.mdy(1,31,1900), 10, 'months') - date.mdy(1,1,1900))], [333.00]], - [[ctime.days(datesum(date.mdy(1,31,1900), 11, 'months') - date.mdy(1,1,1900))], [364.00]], - [[ctime.days(datesum(date.mdy(1,31,1900), 12, 'months') - date.mdy(1,1,1900))], [395.00]], - [[ctime.days(datesum(date.mdy(1,31,1900), 13.9, 'months') - date.mdy(1,1,1900))], [423.00]], - [[ctime.days(datesum(date.mdy(1,31,1900), 1, 'months', 'rollover') - date.mdy(1,1,1900))], [61.00]], - [[ctime.days(datesum(date.mdy(1,31,1900), 2, 'months', 'rollover') - date.mdy(1,1,1900))], [89.00]], - [[ctime.days(datesum(date.mdy(1,31,1900), 3.2, 'months', 'rollover') - date.mdy(1,1,1900))], [120.00]], - [[ctime.days(datesum(date.mdy(1,31,1900), 4, 'months', 'rollover') - date.mdy(1,1,1900))], [150.00]], - [[ctime.days(datesum(date.mdy(1,31,1900), 5, 'months', 'rollover') - date.mdy(1,1,1900))], [181.00]], - [[ctime.days(datesum(date.mdy(1,31,1900), 6, 'months', 'rollover') - date.mdy(1,1,1900))], [211.00]], - [[ctime.days(datesum(date.mdy(1,31,1900), 7, 'months', 'rollover') - date.mdy(1,1,1900))], [242.00]], - [[ctime.days(datesum(date.mdy(1,31,1900), 8, 'months', 'rollover') - date.mdy(1,1,1900))], [273.00]], - [[ctime.days(datesum(date.mdy(1,31,1900), 9, 'months', 'rollover') - date.mdy(1,1,1900))], [303.00]], - [[ctime.days(datesum(date.mdy(1,31,1900), 10, 'months', 'rollover') - date.mdy(1,1,1900))], [334.00]], - [[ctime.days(datesum(date.mdy(1,31,1900), 11, 'months', 'rollover') - date.mdy(1,1,1900))], [364.00]], - [[ctime.days(datesum(date.mdy(1,31,1900), 12, 'months', 'rollover') - date.mdy(1,1,1900))], [395.00]], - [[ctime.days(datesum(date.mdy(1,31,1900), 13, 'months', 'rollover') - date.mdy(1,1,1900))], [426.00]], - -dnl DATESUM with leap year - [[ctime.days(datesum(date.mdy(1,31,1904), 1, 'months') - date.mdy(1,1,1904))], [59.00]], - [[ctime.days(datesum(date.mdy(1,31,1904), 2.5, 'months') - date.mdy(1,1,1904))], [90.00]], - [[ctime.days(datesum(date.mdy(1,31,1904), 3, 'months') - date.mdy(1,1,1904))], [120.00]], - [[ctime.days(datesum(date.mdy(1,31,1904), 4.9, 'months') - date.mdy(1,1,1904))], [151.00]], - [[ctime.days(datesum(date.mdy(1,31,1904), 5.1, 'months') - date.mdy(1,1,1904))], [181.00]], - [[ctime.days(datesum(date.mdy(1,31,1904), 6, 'months') - date.mdy(1,1,1904))], [212.00]], - [[ctime.days(datesum(date.mdy(1,31,1904), 7, 'months') - date.mdy(1,1,1904))], [243.00]], - [[ctime.days(datesum(date.mdy(1,31,1904), 8, 'months') - date.mdy(1,1,1904))], [273.00]], - [[ctime.days(datesum(date.mdy(1,31,1904), 9, 'months') - date.mdy(1,1,1904))], [304.00]], - [[ctime.days(datesum(date.mdy(1,31,1904), 10, 'months') - date.mdy(1,1,1904))], [334.00]], - [[ctime.days(datesum(date.mdy(1,31,1904), 11, 'months') - date.mdy(1,1,1904))], [365.00]], - [[ctime.days(datesum(date.mdy(1,31,1904), 12, 'months') - date.mdy(1,1,1904))], [396.00]], - [[ctime.days(datesum(date.mdy(1,31,1904), 13, 'months') - date.mdy(1,1,1904))], [424.00]], - [[ctime.days(datesum(date.mdy(1,31,1904), 1, 'months', 'rollover') - date.mdy(1,1,1904))], [61.00]], - [[ctime.days(datesum(date.mdy(1,31,1904), 2, 'months', 'rollover') - date.mdy(1,1,1904))], [90.00]], - [[ctime.days(datesum(date.mdy(1,31,1904), 3, 'months', 'rollover') - date.mdy(1,1,1904))], [121.00]], - [[ctime.days(datesum(date.mdy(1,31,1904), 4, 'months', 'rollover') - date.mdy(1,1,1904))], [151.00]], - [[ctime.days(datesum(date.mdy(1,31,1904), 5, 'months', 'rollover') - date.mdy(1,1,1904))], [182.00]], - [[ctime.days(datesum(date.mdy(1,31,1904), 6, 'months', 'rollover') - date.mdy(1,1,1904))], [212.00]], - [[ctime.days(datesum(date.mdy(1,31,1904), 7, 'months', 'rollover') - date.mdy(1,1,1904))], [243.00]], - [[ctime.days(datesum(date.mdy(1,31,1904), 8, 'months', 'rollover') - date.mdy(1,1,1904))], [274.00]], - [[ctime.days(datesum(date.mdy(1,31,1904), 9, 'months', 'rollover') - date.mdy(1,1,1904))], [304.00]], - [[ctime.days(datesum(date.mdy(1,31,1904), 10, 'months', 'rollover') - date.mdy(1,1,1904))], [335.00]], - [[ctime.days(datesum(date.mdy(1,31,1904), 11, 'months', 'rollover') - date.mdy(1,1,1904))], [365.00]], - [[ctime.days(datesum(date.mdy(1,31,1904), 12, 'months', 'rollover') - date.mdy(1,1,1904))], [396.00]], - [[ctime.days(datesum(date.mdy(1,31,1904), 13, 'months', 'rollover') - date.mdy(1,1,1904))], [427.00]], - - [[ctime.days(datesum(date.mdy(6,10,1648), 1, 'weeks') - date.mdy(6,10,1648))], [7.00]], - [[ctime.days(datesum(date.mdy(6,30,1680), 2.5, 'weeks') - date.mdy(6,30,1680))], [17.50]], - [[ctime.days(datesum(date.mdy(7,24,1716), -3, 'weeks') - date.mdy(7,24,1716))], [-21.00]], - [[ctime.days(datesum(date.mdy(6,19,1768), 4, 'weeks') - date.mdy(6,19,1768))], [28.00]], - [[ctime.days(datesum(date.mdy(8,2,1819), 5, 'weeks') - date.mdy(8,2,1819))], [35.00]], - - [[ctime.days(datesum(date.mdy(6,10,1648), 1, 'days') - date.mdy(6,10,1648))], [1.00]], - [[ctime.days(datesum(date.mdy(6,30,1680), 2.5, 'days') - date.mdy(6,30,1680))], [2.50]], - [[ctime.days(datesum(date.mdy(7,24,1716), -3, 'days') - date.mdy(7,24,1716))], [-3.00]], - [[ctime.days(datesum(date.mdy(6,19,1768), 4, 'days') - date.mdy(6,19,1768))], [4.00]], - [[ctime.days(datesum(date.mdy(8,2,1819), 5, 'days') - date.mdy(8,2,1819))], [5.00]], - [[ctime.days(datesum(date.mdy(6,10,1648), 1, 'hours') - date.mdy(6,10,1648))], [0.04]], - [[ctime.days(datesum(date.mdy(6,30,1680), 2.5, 'hours') - date.mdy(6,30,1680))], [0.10]], - [[ctime.days(datesum(date.mdy(6,19,1768), -4, 'hours') - date.mdy(6,19,1768))], [-0.17]], - [[ctime.days(datesum(date.mdy(8,2,1819), 5, 'hours') - date.mdy(8,2,1819))], [0.21]], - -dnl DATESUM preserves time-of-day for units of days and longer. - [[ctime.days(datesum(date.mdy(8,2,1819) + time.hms(1,2,3), 5, 'days') - (date.mdy(8,2,1819) + time.hms(1,2,3)))], [5.00]], - [[ctime.days(datesum(date.mdy(8,2,1819) + time.hms(1,2,3), 5, 'weeks') - (date.mdy(8,2,1819) + time.hms(1,2,3)))], [35.00]], - [[ctime.days(datesum(date.mdy(8,2,1819) + time.hms(1,2,3), 5, 'months') - (date.mdy(8,2,1819) + time.hms(1,2,3)))], [153.00]], - [[ctime.days(datesum(date.mdy(8,2,1819) + time.hms(1,2,3), 5, 'years') - (date.mdy(8,2,1819) + time.hms(1,2,3)))], [1827.00]]) - -CHECK_EXPR_EVAL([miscellaneous], -dnl These test values are from Applied Statistics, Algorithm AS 310. - [[1000 * ncdf.beta(.868,10,20,150)], [937.66]], - [[1000 * ncdf.beta(.9,10,10,120)], [730.68]], - [[1000 * ncdf.beta(.88,15,5,80)], [160.43]], - [[1000 * ncdf.beta(.85,20,10,110)], [186.75]], - [[1000 * ncdf.beta(.66,20,30,65)], [655.94]], - [[1000 * ncdf.beta(.72,20,50,130)], [979.69]], - [[1000 * ncdf.beta(.72,30,20,80)], [116.24]], - [[1000 * ncdf.beta(.8,30,40,130)], [993.04]], +range('1', '2') => error -dnl FIXME: LAG -dnl - [[X], [1.00], [], [(X = 1.00)]], - [[SYSMIS(1)], [false]], - [[SYSMIS($SYSMIS)], [true]], - [[SYSMIS(1 + $SYSMIS)], [true]], +evaluate.sps:76.17-76.41: error: DEBUG EVALUATE: RANGE(string, string, string[, +string, string]...) must have an odd number of arguments. + 76 | DEBUG EVALUATE /range('1', '2', '3', '4'). + | ^~~~~~~~~~~~~~~~~~~~~~~~~ -dnl FIXME: out-of-range and nearly out-of-range values on dates -dnl -dnl Tests correctness of generic optimizations in optimize_tree(). - [[x + 0], [10.00], [], [(X = 10.00)]], - [[x - 0], [-3.00], [], [(X = -3.00)]], - [[0 + x], [5.00], [], [(X = 5.00)]], - [[x * 1], [10.00], [], [(X = 10.00)]], - [[1 * x], [-3.00], [], [(X = -3.00)]], - [[x / 1], [5.00], [], [(X = 5.00)]], - [[0 * x], [0.00], [], [(X = 10.00)]], - [[x * 0], [0.00], [], [(X = -3.00)]], - [[0 / x], [0.00], [], [(X = 5.00)]], - [[mod(0, x)], [0.00], [], [(X = 5.00)]], - [[x ** 1], [5.00], [], [(X = 5.00)]], - [[x ** 2], [25.00], [], [(X = 5.00)]]) - -CHECK_EXPR_EVAL([negative checks], - [[$nonexistent], [error], [error: DEBUG EVALUATE: Unknown system variable $nonexistent.]], - [[RANGE(1, 2)], [error], [error: DEBUG EVALUATE: RANGE(number, number, number[, number, number]...) must have an odd number of arguments.]], - [[CONCAT.1('a', 'b')], [error], [error: DEBUG EVALUATE: CONCAT(string[, string]...) function cannot accept suffix .1 to specify the minimum number of valid arguments.]], - [[foobar(x)], [error], [error: DEBUG EVALUATE: No function or vector named foobar.]], - [[CONCAT.1('a' b)], [error], [error: DEBUG EVALUATE: Syntax error at `b': expecting `,' or `)'.]], - [[NCDF.CHISQ(1, 2, 3)], [error], [error: DEBUG EVALUATE: NCDF.CHISQ(number, number, number) is not available in this version of PSPP.]]) - -AT_SETUP([LAG function]) +range('1', '2', '3', '4') => error + +evaluate.sps:77.17-77.51: error: DEBUG EVALUATE: RANGE(string, string, string[, +string, string]...) must have an odd number of arguments. + 77 | DEBUG EVALUATE /range('1', '2', '3', '4', '5', '6'). + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +range('1', '2', '3', '4', '5', '6') => error + +evaluate.sps:78.17-78.34: error: DEBUG EVALUATE: Function invocation +range(number, string, string) does not match any known function. Candidates +are: +RANGE(number, number, number[, number, number]...) +RANGE(string, string, string[, string, string]...). + 78 | DEBUG EVALUATE /range(1, '2', '3'). + | ^~~~~~~~~~~~~~~~~~ + +range(1, '2', '3') => error + +evaluate.sps:79.17-79.34: error: DEBUG EVALUATE: Function invocation +range(string, number, string) does not match any known function. Candidates +are: +RANGE(number, number, number[, number, number]...) +RANGE(string, string, string[, string, string]...). + 79 | DEBUG EVALUATE /range('1', 2, '3'). + | ^~~~~~~~~~~~~~~~~~ + +range('1', 2, '3') => error + +evaluate.sps:80.17-80.34: error: DEBUG EVALUATE: Function invocation +range(string, string, number) does not match any known function. Candidates +are: +RANGE(number, number, number[, number, number]...) +RANGE(string, string, string[, string, string]...). + 80 | DEBUG EVALUATE /range('1', '2', 3). + | ^~~~~~~~~~~~~~~~~~ + +range('1', '2', 3) => error +]]) +done +AT_CLEANUP + +AT_SETUP([expressions - MAX MIN]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +DEBUG EVALUATE /max(1, 2, 3, 4, 5). +DEBUG EVALUATE /max(1, $sysmis, 2, 3, $sysmis, 4, 5). +DEBUG EVALUATE /max(1, 2). +DEBUG EVALUATE /max(). +DEBUG EVALUATE /max(1). +DEBUG EVALUATE /max(1, $sysmis). +DEBUG EVALUATE /max(1, 2, 3, $sysmis). +DEBUG EVALUATE /max.4(1, 2, 3, $sysmis). +DEBUG EVALUATE /max.4(1, 2, 3). + +DEBUG EVALUATE /max("2", "3", "5", "1", "4"). +DEBUG EVALUATE /max("1", "2"). +DEBUG EVALUATE /max("1"). + +DEBUG EVALUATE /min(1, 2, 3, 4, 5). +DEBUG EVALUATE /min(1, $sysmis, 2, 3, $sysmis, 4, 5). +DEBUG EVALUATE /min(1, 2). +DEBUG EVALUATE /min(). +DEBUG EVALUATE /min(1). +DEBUG EVALUATE /min(1, $sysmis). +DEBUG EVALUATE /min(1, 2, 3, $sysmis). +DEBUG EVALUATE /min.4(1, 2, 3, $sysmis). +DEBUG EVALUATE /min.4(1, 2, 3). + +DEBUG EVALUATE /min("2", "3", "5", "1", "4"). +DEBUG EVALUATE /min("1", "2"). +DEBUG EVALUATE /min("1"). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], +[[max(1, 2, 3, 4, 5) => 5.00 + +max(1, $sysmis, 2, 3, $sysmis, 4, 5) => 5.00 + +max(1, 2) => 2.00 + +evaluate.sps:6.17-6.20: error: DEBUG EVALUATE: Function invocation max() does +not match any known function. Candidates are: +MAX(number[, number]...) +MAX(string[, string]...). + 6 | DEBUG EVALUATE /max(). + | ^~~~ + +max() => error + +max(1) => 1.00 + +max(1, $sysmis) => 1.00 + +max(1, 2, 3, $sysmis) => 3.00 + +max.4(1, 2, 3, $sysmis) => sysmis + +evaluate.sps:11.17-11.30: error: DEBUG EVALUATE: For MAX(number[, number]...) +with 3 arguments, at most 3 (not 4) may be required to be valid. + 11 | DEBUG EVALUATE /max.4(1, 2, 3). + | ^~~~~~~~~~~~~~ + +max.4(1, 2, 3) => error + +max("2", "3", "5", "1", "4") => "5" + +max("1", "2") => "2" + +max("1") => "1" + +min(1, 2, 3, 4, 5) => 1.00 + +min(1, $sysmis, 2, 3, $sysmis, 4, 5) => 1.00 + +min(1, 2) => 1.00 + +evaluate.sps:20.17-20.20: error: DEBUG EVALUATE: Function invocation min() does +not match any known function. Candidates are: +MIN(number[, number]...) +MIN(string[, string]...). + 20 | DEBUG EVALUATE /min(). + | ^~~~ + +min() => error + +min(1) => 1.00 + +min(1, $sysmis) => 1.00 + +min(1, 2, 3, $sysmis) => 1.00 + +min.4(1, 2, 3, $sysmis) => sysmis + +evaluate.sps:25.17-25.30: error: DEBUG EVALUATE: For MIN(number[, number]...) +with 3 arguments, at most 3 (not 4) may be required to be valid. + 25 | DEBUG EVALUATE /min.4(1, 2, 3). + | ^~~~~~~~~~~~~~ + +min.4(1, 2, 3) => error + +min("2", "3", "5", "1", "4") => "1" + +min("1", "2") => "1" + +min("1") => "1" +]]) +done +AT_CLEANUP + +AT_SETUP([expressions - CFVAR MEAN MEDIAN]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. + +DEBUG EVALUATE /cfvar(1, 2, 3, 4, 5). +DEBUG EVALUATE /cfvar(1, $sysmis, 2, 3, $sysmis, 4, 5). +DEBUG EVALUATE /cfvar(1, 2). +DEBUG EVALUATE /cfvar(1). +DEBUG EVALUATE /cfvar(1, $sysmis). +DEBUG EVALUATE /cfvar(1, 2, 3, $sysmis). +DEBUG EVALUATE /cfvar.4(1, 2, 3, $sysmis). +DEBUG EVALUATE /cfvar.4(1, 2, 3). +DEBUG EVALUATE /cfvar('x'). +DEBUG EVALUATE /cfvar('x', 1, 2, 3). + +DEBUG EVALUATE /mean(1, 2, 3, 4, 5). +DEBUG EVALUATE /mean(1, $sysmis, 2, 3, $sysmis, 4, 5). +DEBUG EVALUATE /mean(1, 2). +DEBUG EVALUATE /mean(). +DEBUG EVALUATE /mean(1). +DEBUG EVALUATE /mean(1, $sysmis). +DEBUG EVALUATE /mean(1, 2, 3, $sysmis). +DEBUG EVALUATE /mean.4(1, 2, 3, $sysmis). +DEBUG EVALUATE /mean.4(1, 2, 3). + +DEBUG EVALUATE /median(1, 2, 3, 4, 5). +DEBUG EVALUATE /median(2, 3, 4, 5, 1). +DEBUG EVALUATE /median(2, 3, 4, 1, 5). +DEBUG EVALUATE /median(2, 1, 4, 5, 3). +DEBUG EVALUATE /median(1, 2, 3, 4). +DEBUG EVALUATE /median(2, 3, 1, 4). +DEBUG EVALUATE /median(2, 3, 4, 1). +DEBUG EVALUATE /median(2, 1, 4, 3). +DEBUG EVALUATE /median(1, $sysmis, 3, 4, 5). +DEBUG EVALUATE /median(2, 3, 4, 5, $sysmis, 1). +DEBUG EVALUATE /median($sysmis, $sysmis, $sysmis, 2, 3, 4, 1, 5). +DEBUG EVALUATE /median(1, 2, 3). +DEBUG EVALUATE /median(1). +DEBUG EVALUATE /median(1, 2). +DEBUG EVALUATE /median(1, 2, $sysmis). +DEBUG EVALUATE /median(1, $sysmis, $sysmis). +DEBUG EVALUATE /median($sysmis, $sysmis, $sysmis). +DEBUG EVALUATE /median.3(1, 2, $sysmis). +DEBUG EVALUATE /median.2(1, $sysmis). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], +[[cfvar(1, 2, 3, 4, 5) => 0.53 + +cfvar(1, $sysmis, 2, 3, $sysmis, 4, 5) => 0.53 + +cfvar(1, 2) => 0.47 + +evaluate.sps:7.17-7.24: error: DEBUG EVALUATE: Type mismatch invoking +CFVAR(number, number[, number]...) as cfvar(number). + 7 | DEBUG EVALUATE /cfvar(1). + | ^~~~~~~~ + +cfvar(1) => error + +cfvar(1, $sysmis) => sysmis + +cfvar(1, 2, 3, $sysmis) => 0.50 + +cfvar.4(1, 2, 3, $sysmis) => sysmis + +evaluate.sps:11.17-11.32: error: DEBUG EVALUATE: For CFVAR(number, number[, +number]...) with 3 arguments, at most 3 (not 4) may be required to be valid. + 11 | DEBUG EVALUATE /cfvar.4(1, 2, 3). + | ^~~~~~~~~~~~~~~~ + +cfvar.4(1, 2, 3) => error + +evaluate.sps:12.17-12.26: error: DEBUG EVALUATE: Type mismatch invoking +CFVAR(number, number[, number]...) as cfvar(string). + 12 | DEBUG EVALUATE /cfvar('x'). + | ^~~~~~~~~~ + +cfvar('x') => error + +evaluate.sps:13.17-13.35: error: DEBUG EVALUATE: Type mismatch invoking +CFVAR(number, number[, number]...) as cfvar(string, number, number, number). + 13 | DEBUG EVALUATE /cfvar('x', 1, 2, 3). + | ^~~~~~~~~~~~~~~~~~~ + +cfvar('x', 1, 2, 3) => error + +mean(1, 2, 3, 4, 5) => 3.00 + +mean(1, $sysmis, 2, 3, $sysmis, 4, 5) => 3.00 + +mean(1, 2) => 1.50 + +evaluate.sps:18.17-18.21: error: DEBUG EVALUATE: Type mismatch invoking +MEAN(number[, number]...) as mean(). + 18 | DEBUG EVALUATE /mean(). + | ^~~~~ + +mean() => error + +mean(1) => 1.00 + +mean(1, $sysmis) => 1.00 + +mean(1, 2, 3, $sysmis) => 2.00 + +mean.4(1, 2, 3, $sysmis) => sysmis + +evaluate.sps:23.17-23.31: error: DEBUG EVALUATE: For MEAN(number[, number]...) +with 3 arguments, at most 3 (not 4) may be required to be valid. + 23 | DEBUG EVALUATE /mean.4(1, 2, 3). + | ^~~~~~~~~~~~~~~ + +mean.4(1, 2, 3) => error + +median(1, 2, 3, 4, 5) => 3.00 + +median(2, 3, 4, 5, 1) => 3.00 + +median(2, 3, 4, 1, 5) => 3.00 + +median(2, 1, 4, 5, 3) => 3.00 + +median(1, 2, 3, 4) => 2.50 + +median(2, 3, 1, 4) => 2.50 + +median(2, 3, 4, 1) => 2.50 + +median(2, 1, 4, 3) => 2.50 + +median(1, $sysmis, 3, 4, 5) => 3.50 + +median(2, 3, 4, 5, $sysmis, 1) => 3.00 + +median($sysmis, $sysmis, $sysmis, 2, 3, 4, 1, 5) => 3.00 + +median(1, 2, 3) => 2.00 + +median(1) => 1.00 + +median(1, 2) => 1.50 + +median(1, 2, $sysmis) => 1.50 + +median(1, $sysmis, $sysmis) => 1.00 + +median($sysmis, $sysmis, $sysmis) => sysmis + +median.3(1, 2, $sysmis) => sysmis + +median.2(1, $sysmis) => sysmis +]]) +done +AT_CLEANUP + +AT_SETUP([expressions - SD SUM VARIANCE]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. + +DEBUG EVALUATE /sd(1, 2, 3, 4, 5). +DEBUG EVALUATE /sd(1, $sysmis, 2, 3, $sysmis, 4, 5). +DEBUG EVALUATE /sd(1, 2). +DEBUG EVALUATE /sd(1). +DEBUG EVALUATE /sd(1, $sysmis). +DEBUG EVALUATE /sd(1, 2, 3, $sysmis). +DEBUG EVALUATE /sd.4(1, 2, 3, $sysmis). +DEBUG EVALUATE /sd.4(1, 2, 3). +DEBUG EVALUATE /sd('x'). +DEBUG EVALUATE /sd('x', 1, 2, 3). +DEBUG EVALUATE (a=1)(b=2)(c=3)(d=4)(e=5)(f=6)(g=7)/sd(a TO c). + +DEBUG EVALUATE /sum(1, 2, 3, 4, 5). +DEBUG EVALUATE /sum(1, $sysmis, 2, 3, $sysmis, 4, 5). +DEBUG EVALUATE /sum(1, 2). +DEBUG EVALUATE /sum(). +DEBUG EVALUATE /sum(1). +DEBUG EVALUATE /sum(1, $sysmis). +DEBUG EVALUATE /sum(1, 2, 3, $sysmis). +DEBUG EVALUATE /sum.4(1, 2, 3, $sysmis). +DEBUG EVALUATE /sum.4(1, 2, 3). +DEBUG EVALUATE (a=1)(b=2)(c=3)(d=4)(e=5)(f=6)(g=7)/sum(b TO F). + +DEBUG EVALUATE /variance(1, 2, 3, 4, 5). +DEBUG EVALUATE /variance(1, $sysmis, 2, 3, $sysmis, 4, 5). +DEBUG EVALUATE /variance(1, 2). +DEBUG EVALUATE /variance(1). +DEBUG EVALUATE /variance(1, $sysmis). +DEBUG EVALUATE /variance(1, 2, 3, $sysmis). +DEBUG EVALUATE /variance.4(1, 2, 3, $sysmis). +DEBUG EVALUATE /variance.4(1, 2, 3). +DEBUG EVALUATE /variance('x'). +DEBUG EVALUATE /variance('x', 1, 2, 3). +DEBUG EVALUATE (a=1)(b=2)(c=3)(d=4)(e=5)(f=6)(g=7)/variance(a TO e). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], +[[sd(1, 2, 3, 4, 5) => 1.58 + +sd(1, $sysmis, 2, 3, $sysmis, 4, 5) => 1.58 + +sd(1, 2) => 0.71 + +evaluate.sps:7.17-7.21: error: DEBUG EVALUATE: Type mismatch invoking +SD(number, number[, number]...) as sd(number). + 7 | DEBUG EVALUATE /sd(1). + | ^~~~~ + +sd(1) => error + +sd(1, $sysmis) => sysmis + +sd(1, 2, 3, $sysmis) => 1.00 + +sd.4(1, 2, 3, $sysmis) => sysmis + +evaluate.sps:11.17-11.29: error: DEBUG EVALUATE: For SD(number, number[, +number]...) with 3 arguments, at most 3 (not 4) may be required to be valid. + 11 | DEBUG EVALUATE /sd.4(1, 2, 3). + | ^~~~~~~~~~~~~ + +sd.4(1, 2, 3) => error + +evaluate.sps:12.17-12.23: error: DEBUG EVALUATE: Type mismatch invoking +SD(number, number[, number]...) as sd(string). + 12 | DEBUG EVALUATE /sd('x'). + | ^~~~~~~ + +sd('x') => error + +evaluate.sps:13.17-13.32: error: DEBUG EVALUATE: Type mismatch invoking +SD(number, number[, number]...) as sd(string, number, number, number). + 13 | DEBUG EVALUATE /sd('x', 1, 2, 3). + | ^~~~~~~~~~~~~~~~ + +sd('x', 1, 2, 3) => error + +sd(a TO c) => 1.00 + +sum(1, 2, 3, 4, 5) => 15.00 + +sum(1, $sysmis, 2, 3, $sysmis, 4, 5) => 15.00 + +sum(1, 2) => 3.00 + +evaluate.sps:19.17-19.20: error: DEBUG EVALUATE: Type mismatch invoking +SUM(number[, number]...) as sum(). + 19 | DEBUG EVALUATE /sum(). + | ^~~~ + +sum() => error + +sum(1) => 1.00 + +sum(1, $sysmis) => 1.00 + +sum(1, 2, 3, $sysmis) => 6.00 + +sum.4(1, 2, 3, $sysmis) => sysmis + +evaluate.sps:24.17-24.30: error: DEBUG EVALUATE: For SUM(number[, number]...) +with 3 arguments, at most 3 (not 4) may be required to be valid. + 24 | DEBUG EVALUATE /sum.4(1, 2, 3). + | ^~~~~~~~~~~~~~ + +sum.4(1, 2, 3) => error + +sum(b TO F) => 20.00 + +variance(1, 2, 3, 4, 5) => 2.50 + +variance(1, $sysmis, 2, 3, $sysmis, 4, 5) => 2.50 + +variance(1, 2) => 0.50 + +evaluate.sps:30.17-30.27: error: DEBUG EVALUATE: Type mismatch invoking +VARIANCE(number, number[, number]...) as variance(number). + 30 | DEBUG EVALUATE /variance(1). + | ^~~~~~~~~~~ + +variance(1) => error + +variance(1, $sysmis) => sysmis + +variance(1, 2, 3, $sysmis) => 1.00 + +variance.4(1, 2, 3, $sysmis) => sysmis + +evaluate.sps:34.17-34.35: error: DEBUG EVALUATE: For VARIANCE(number, number[, +number]...) with 3 arguments, at most 3 (not 4) may be required to be valid. + 34 | DEBUG EVALUATE /variance.4(1, 2, 3). + | ^~~~~~~~~~~~~~~~~~~ + +variance.4(1, 2, 3) => error + +evaluate.sps:35.17-35.29: error: DEBUG EVALUATE: Type mismatch invoking +VARIANCE(number, number[, number]...) as variance(string). + 35 | DEBUG EVALUATE /variance('x'). + | ^~~~~~~~~~~~~ + +variance('x') => error + +evaluate.sps:36.17-36.38: error: DEBUG EVALUATE: Type mismatch invoking +VARIANCE(number, number[, number]...) as variance(string, number, number, +number). + 36 | DEBUG EVALUATE /variance('x', 1, 2, 3). + | ^~~~~~~~~~~~~~~~~~~~~~ + +variance('x', 1, 2, 3) => error + +variance(a TO e) => 2.50 +]]) +done +AT_CLEANUP + +AT_SETUP([expressions - CONCAT]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. + +DEBUG EVALUATE /concat(''). +DEBUG EVALUATE /concat('a', 'b'). +DEBUG EVALUATE /concat('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'). +DEBUG EVALUATE /concat('abcdefgh', 'ijklmnopq'). +DEBUG EVALUATE /concat('a', 1). +DEBUG EVALUATE /concat(1, 2). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], +[[concat('') => "" + +concat('a', 'b') => "ab" + +concat('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h') => "abcdefgh" + +concat('abcdefgh', 'ijklmnopq') => "abcdefghijklmnopq" + +evaluate.sps:8.17-8.30: error: DEBUG EVALUATE: Type mismatch invoking +CONCAT(string[, string]...) as concat(string, number). + 8 | DEBUG EVALUATE /concat('a', 1). + | ^~~~~~~~~~~~~~ + +concat('a', 1) => error + +evaluate.sps:9.17-9.28: error: DEBUG EVALUATE: Type mismatch invoking +CONCAT(string[, string]...) as concat(number, number). + 9 | DEBUG EVALUATE /concat(1, 2). + | ^~~~~~~~~~~~ + +concat(1, 2) => error +]]) +done +AT_CLEANUP + +AT_SETUP([expressions - INDEX]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. + +DEBUG EVALUATE /index('abcbcde', 'bc'). +DEBUG EVALUATE /index('abcbcde', 'bcd'). +DEBUG EVALUATE /index('abcbcde', 'bcbc'). +DEBUG EVALUATE /index('abcdefgh', 'abc'). +DEBUG EVALUATE /index('abcdefgh', 'bcd'). +DEBUG EVALUATE /index('abcdefgh', 'cde'). +DEBUG EVALUATE /index('abcdefgh', 'def'). +DEBUG EVALUATE /index('abcdefgh', 'efg'). +DEBUG EVALUATE /index('abcdefgh', 'fgh'). +DEBUG EVALUATE /index('abcdefgh', 'fghi'). +DEBUG EVALUATE /index('abcdefgh', 'x'). +DEBUG EVALUATE /index('abcdefgh', 'abch'). +DEBUG EVALUATE /index('banana', 'na'). +DEBUG EVALUATE /index('banana', 'ana'). +DEBUG EVALUATE /index('', 'x'). +DEBUG EVALUATE /index('', ''). +DEBUG EVALUATE /index('abcdefgh', ''). +DEBUG EVALUATE /index('abcdefgh', 'alkjsfdjlskalkjfa'). + +DEBUG EVALUATE /index('abcbcde', 'bc', 1). +DEBUG EVALUATE /index('abcbcde', 'dc', 1). +DEBUG EVALUATE /index('abcbcde', 'abc', 1). +DEBUG EVALUATE /index('abcbcde', 'bc', 2). +DEBUG EVALUATE /index('abcbcde', 'dc', 2). +DEBUG EVALUATE /index('abcbcde', 'abc', 1). +DEBUG EVALUATE /index('abcbcde', 'bccb', 2). +DEBUG EVALUATE /index('abcbcde', 'bcbc', 2). +DEBUG EVALUATE /index('abcbcde', 'bcbc', $sysmis). +DEBUG EVALUATE /index('abcbcde', 'bcbc', 3). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +index('abcbcde', 'bc') => 2.00 + +index('abcbcde', 'bcd') => 4.00 + +index('abcbcde', 'bcbc') => 2.00 + +index('abcdefgh', 'abc') => 1.00 + +index('abcdefgh', 'bcd') => 2.00 + +index('abcdefgh', 'cde') => 3.00 + +index('abcdefgh', 'def') => 4.00 + +index('abcdefgh', 'efg') => 5.00 + +index('abcdefgh', 'fgh') => 6.00 + +index('abcdefgh', 'fghi') => 0.00 + +index('abcdefgh', 'x') => 0.00 + +index('abcdefgh', 'abch') => 0.00 + +index('banana', 'na') => 3.00 + +index('banana', 'ana') => 2.00 + +index('', 'x') => 0.00 + +index('', '') => 1.00 + +index('abcdefgh', '') => 1.00 + +index('abcdefgh', 'alkjsfdjlskalkjfa') => 0.00 + +index('abcbcde', 'bc', 1) => 2.00 + +index('abcbcde', 'dc', 1) => 3.00 + +index('abcbcde', 'abc', 1) => 1.00 + +index('abcbcde', 'bc', 2) => 2.00 + +index('abcbcde', 'dc', 2) => 0.00 + +index('abcbcde', 'abc', 1) => 1.00 + +index('abcbcde', 'bccb', 2) => 2.00 + +index('abcbcde', 'bcbc', 2) => 2.00 + +index('abcbcde', 'bcbc', $sysmis) => sysmis + +evaluate.sps:32.17-32.43: error: DEBUG EVALUATE: INDEX needle length argument +must evenly divide the length of the needles argument. + 32 | DEBUG EVALUATE /index('abcbcde', 'bcbc', 3). + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ + +evaluate.sps:32.34-32.39: note: DEBUG EVALUATE: The needles argument has length +4. + 32 | DEBUG EVALUATE /index('abcbcde', 'bcbc', 3). + | ^~~~~~ + +evaluate.sps:32.42: note: DEBUG EVALUATE: The needle length argument has value +3. + 32 | DEBUG EVALUATE /index('abcbcde', 'bcbc', 3). + | ^ + +index('abcbcde', 'bcbc', 3) => sysmis +]) +done +AT_CLEANUP + +AT_SETUP([expressions - RINDEX]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. + +DEBUG EVALUATE /rindex('abcbcde', 'bc'). +DEBUG EVALUATE /rindex('abcbcde', 'bcd'). +DEBUG EVALUATE /rindex('abcbcde', 'bcbc'). +DEBUG EVALUATE /rindex('abcdefgh', 'abc'). +DEBUG EVALUATE /rindex('abcdefgh', 'bcd'). +DEBUG EVALUATE /rindex('abcdefgh', 'cde'). +DEBUG EVALUATE /rindex('abcdefgh', 'def'). +DEBUG EVALUATE /rindex('abcdefgh', 'efg'). +DEBUG EVALUATE /rindex('abcdefgh', 'fgh'). +DEBUG EVALUATE /rindex('abcdefgh', 'fghi'). +DEBUG EVALUATE /rindex('abcdefgh', 'x'). +DEBUG EVALUATE /rindex('abcdefgh', 'abch'). +DEBUG EVALUATE /rindex('banana', 'na'). +DEBUG EVALUATE /rindex('banana', 'ana'). +DEBUG EVALUATE /rindex('', 'x'). +DEBUG EVALUATE /rindex('', ''). +DEBUG EVALUATE /rindex('abcdefgh', ''). +DEBUG EVALUATE /rindex('abcdefgh', 'alkjsfdjlskalkjfa'). + +DEBUG EVALUATE /rindex('abcbcde', 'bc', 1). +DEBUG EVALUATE /rindex('abcbcde', 'dc', 1). +DEBUG EVALUATE /rindex('abcbcde', 'abc', 1). +DEBUG EVALUATE /rindex('abcbcde', 'bc', 2). +DEBUG EVALUATE /rindex('abcbcde', 'dc', 2). +DEBUG EVALUATE /rindex('abcbcde', 'abc', 1). +DEBUG EVALUATE /rindex('abcbcde', 'bccb', 2). +DEBUG EVALUATE /rindex('abcbcde', 'bcbc', 2). +DEBUG EVALUATE /rindex('abcbcde', 'bcbc', 0). +DEBUG EVALUATE /rindex('abcbcde', 'bcbc', $sysmis). +DEBUG EVALUATE /rindex('abcbcde', 'bcbcg', 2). +DEBUG EVALUATE /rindex('abcbcde', 'bcbcg', $sysmis). +DEBUG EVALUATE /rindex('abcbcde', 'bcbcg', 'x'). +DEBUG EVALUATE /rindex(1, 'bcdfkjl', 2). +DEBUG EVALUATE /rindex('aksj', 2, 2). +DEBUG EVALUATE /rindex(1, 2, 3). +DEBUG EVALUATE /rindex(1, 2, '3'). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +rindex('abcbcde', 'bc') => 4.00 + +rindex('abcbcde', 'bcd') => 4.00 + +rindex('abcbcde', 'bcbc') => 2.00 + +rindex('abcdefgh', 'abc') => 1.00 + +rindex('abcdefgh', 'bcd') => 2.00 + +rindex('abcdefgh', 'cde') => 3.00 + +rindex('abcdefgh', 'def') => 4.00 + +rindex('abcdefgh', 'efg') => 5.00 + +rindex('abcdefgh', 'fgh') => 6.00 + +rindex('abcdefgh', 'fghi') => 0.00 + +rindex('abcdefgh', 'x') => 0.00 + +rindex('abcdefgh', 'abch') => 0.00 + +rindex('banana', 'na') => 5.00 + +rindex('banana', 'ana') => 4.00 + +rindex('', 'x') => 0.00 + +rindex('', '') => 1.00 + +rindex('abcdefgh', '') => 9.00 + +rindex('abcdefgh', 'alkjsfdjlskalkjfa') => 0.00 + +rindex('abcbcde', 'bc', 1) => 5.00 + +rindex('abcbcde', 'dc', 1) => 6.00 + +rindex('abcbcde', 'abc', 1) => 5.00 + +rindex('abcbcde', 'bc', 2) => 4.00 + +rindex('abcbcde', 'dc', 2) => 0.00 + +rindex('abcbcde', 'abc', 1) => 5.00 + +rindex('abcbcde', 'bccb', 2) => 4.00 + +rindex('abcbcde', 'bcbc', 2) => 4.00 + +evaluate.sps:31.17-31.44: error: DEBUG EVALUATE: RINDEX needle length argument +must evenly divide the length of the needles argument. + 31 | DEBUG EVALUATE /rindex('abcbcde', 'bcbc', 0). + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +evaluate.sps:31.35-31.40: note: DEBUG EVALUATE: The needles argument has length +4. + 31 | DEBUG EVALUATE /rindex('abcbcde', 'bcbc', 0). + | ^~~~~~ + +evaluate.sps:31.43: note: DEBUG EVALUATE: The needle length argument has value +0. + 31 | DEBUG EVALUATE /rindex('abcbcde', 'bcbc', 0). + | ^ + +rindex('abcbcde', 'bcbc', 0) => sysmis + +rindex('abcbcde', 'bcbc', $sysmis) => sysmis + +evaluate.sps:33.17-33.45: error: DEBUG EVALUATE: RINDEX needle length argument +must evenly divide the length of the needles argument. + 33 | DEBUG EVALUATE /rindex('abcbcde', 'bcbcg', 2). + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +evaluate.sps:33.35-33.41: note: DEBUG EVALUATE: The needles argument has length +5. + 33 | DEBUG EVALUATE /rindex('abcbcde', 'bcbcg', 2). + | ^~~~~~~ + +evaluate.sps:33.44: note: DEBUG EVALUATE: The needle length argument has value +2. + 33 | DEBUG EVALUATE /rindex('abcbcde', 'bcbcg', 2). + | ^ + +rindex('abcbcde', 'bcbcg', 2) => sysmis + +rindex('abcbcde', 'bcbcg', $sysmis) => sysmis + +evaluate.sps:35.17-35.47: error: DEBUG EVALUATE: Function invocation +rindex(string, string, string) does not match any known function. Candidates +are: +RINDEX(string, string) +RINDEX(string, string, integer). + 35 | DEBUG EVALUATE /rindex('abcbcde', 'bcbcg', 'x'). + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +rindex('abcbcde', 'bcbcg', 'x') => error + +evaluate.sps:36.17-36.39: error: DEBUG EVALUATE: Function invocation +rindex(number, string, number) does not match any known function. Candidates +are: +RINDEX(string, string) +RINDEX(string, string, integer). + 36 | DEBUG EVALUATE /rindex(1, 'bcdfkjl', 2). + | ^~~~~~~~~~~~~~~~~~~~~~~ + +rindex(1, 'bcdfkjl', 2) => error + +evaluate.sps:37.17-37.36: error: DEBUG EVALUATE: Function invocation +rindex(string, number, number) does not match any known function. Candidates +are: +RINDEX(string, string) +RINDEX(string, string, integer). + 37 | DEBUG EVALUATE /rindex('aksj', 2, 2). + | ^~~~~~~~~~~~~~~~~~~~ + +rindex('aksj', 2, 2) => error + +evaluate.sps:38.17-38.31: error: DEBUG EVALUATE: Function invocation +rindex(number, number, number) does not match any known function. Candidates +are: +RINDEX(string, string) +RINDEX(string, string, integer). + 38 | DEBUG EVALUATE /rindex(1, 2, 3). + | ^~~~~~~~~~~~~~~ + +rindex(1, 2, 3) => error + +evaluate.sps:39.17-39.33: error: DEBUG EVALUATE: Function invocation +rindex(number, number, string) does not match any known function. Candidates +are: +RINDEX(string, string) +RINDEX(string, string, integer). + 39 | DEBUG EVALUATE /rindex(1, 2, '3'). + | ^~~~~~~~~~~~~~~~~ + +rindex(1, 2, '3') => error +]) +done +AT_CLEANUP + +AT_SETUP([expressions - LENGTH]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. + +DEBUG EVALUATE /length(''). +DEBUG EVALUATE /length('a'). +DEBUG EVALUATE /length('xy'). +DEBUG EVALUATE /length('adsf '). +DEBUG EVALUATE /length('abcdefghijkl'). +DEBUG EVALUATE /length(0). +DEBUG EVALUATE /length($sysmis). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +length('') => 0.00 + +length('a') => 1.00 + +length('xy') => 2.00 + +length('adsf ') => 8.00 + +length('abcdefghijkl') => 12.00 + +evaluate.sps:9.17-9.25: error: DEBUG EVALUATE: Type mismatch invoking +LENGTH(string) as length(number). + 9 | DEBUG EVALUATE /length(0). + | ^~~~~~~~~ + +length(0) => error + +evaluate.sps:10.17-10.31: error: DEBUG EVALUATE: Type mismatch invoking +LENGTH(string) as length(number). + 10 | DEBUG EVALUATE /length($sysmis). + | ^~~~~~~~~~~~~~~ + +length($sysmis) => error +]) +done +AT_CLEANUP + +AT_SETUP([expressions - LOWER]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. + +DEBUG EVALUATE /lower('ABCDEFGHIJKLMNOPQRSTUVWXYZ!@%&*089'). +DEBUG EVALUATE /lower(''). +DEBUG EVALUATE /lower(1). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +lower('ABCDEFGHIJKLMNOPQRSTUVWXYZ!@%&*089') => "abcdefghijklmnopqrstuvwxyz!@ +%&*089" + +lower('') => "" + +evaluate.sps:6.17-6.24: error: DEBUG EVALUATE: Type mismatch invoking +LOWER(string) as lower(number). + 6 | DEBUG EVALUATE /lower(1). + | ^~~~~~~~ + +lower(1) => error +]) +done +AT_CLEANUP + +AT_SETUP([expressions - REPLACE]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +DEBUG EVALUATE /replace('banana', 'an', 'AN'). +DEBUG EVALUATE /replace('banana', 'an', 'a'). +DEBUG EVALUATE /replace('banana', 'an', ''). +DEBUG EVALUATE /replace('banana', 'na', ''). +DEBUG EVALUATE /replace('banana', 'ba', 'BA'). +DEBUG EVALUATE /replace('banana', 'na', 'xyzzy'). +DEBUG EVALUATE /replace('banana', 'an', 'xyzzy', 1). +DEBUG EVALUATE /replace('banana', 'an', 'xyzzy', 1.5). +DEBUG EVALUATE /replace('banana', 'bananana', 'xyzzy'). +DEBUG EVALUATE /replace('banana', '', 'xyzzy'). +DEBUG EVALUATE /replace('banana', 'ba', '', 0). +DEBUG EVALUATE /replace('banana', 'ba', '', -1). +DEBUG EVALUATE /replace('banana', 'ba', '', $sysmis). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +replace('banana', 'an', 'AN') => "bANANa" + +replace('banana', 'an', 'a') => "baaa" + +replace('banana', 'an', '') => "ba" + +replace('banana', 'na', '') => "ba" + +replace('banana', 'ba', 'BA') => "BAnana" + +replace('banana', 'na', 'xyzzy') => "baxyzzyxyzzy" + +replace('banana', 'an', 'xyzzy', 1) => "bxyzzyana" + +evaluate.sps:10.50-10.52: error: DEBUG EVALUATE: Treating unexpected non- +integer value 1.5 as missing. + 10 | DEBUG EVALUATE /replace('banana', 'an', 'xyzzy', 1.5). + | ^~~ + +replace('banana', 'an', 'xyzzy', 1.5) => "banana" + +replace('banana', 'bananana', 'xyzzy') => "banana" + +replace('banana', '', 'xyzzy') => "banana" + +replace('banana', 'ba', '', 0) => "banana" + +replace('banana', 'ba', '', -1) => "banana" + +replace('banana', 'ba', '', $sysmis) => "banana" +]) +done +AT_CLEANUP + +AT_SETUP([expressions - LPAD]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [dnl +DEBUG EVALUATE SET opt. + +DEBUG EVALUATE /lpad('abc', 0). +DEBUG EVALUATE /lpad('abc', 2). +DEBUG EVALUATE /lpad('abc', 3). +DEBUG EVALUATE /lpad('abc', 10). + +DEBUG EVALUATE /lpad('abc', -1). +DEBUG EVALUATE /lpad('abc', 32768). +DEBUG EVALUATE /lpad('abc', $sysmis). + +DEBUG EVALUATE /lpad('abc', -1, '*'). +DEBUG EVALUATE /lpad('abc', 0, '*'). +DEBUG EVALUATE /lpad('abc', 2, '*'). +DEBUG EVALUATE /lpad('abc', 3, '*'). +DEBUG EVALUATE /lpad('abc', 10, '*'). + +DEBUG EVALUATE /lpad('abc', 5, 'de'). +DEBUG EVALUATE /lpad('abc', 6, 'de'). +DEBUG EVALUATE /lpad('abc', 7, 'de'). +DEBUG EVALUATE /lpad('abc', 8, 'de'). +DEBUG EVALUATE /lpad('abc', 9, 'de'). + +DEBUG EVALUATE /lpad('abc', 32768, '*'). +DEBUG EVALUATE /lpad('abc', $sysmis, '*'). +DEBUG EVALUATE /lpad('abc', $sysmis, ''). +DEBUG EVALUATE /lpad('abc', $sysmis, 'xy'). +DEBUG EVALUATE /lpad(0, 10). +DEBUG EVALUATE /lpad('abc', 'def'). +DEBUG EVALUATE /lpad(0, 10, ' '). +DEBUG EVALUATE /lpad('abc', 'def', ' '). +DEBUG EVALUATE /lpad('x', 5, 0). +DEBUG EVALUATE /lpad('x', 5, 2). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +lpad('abc', 0) => "abc" + +lpad('abc', 2) => "abc" + +lpad('abc', 3) => "abc" + +lpad('abc', 10) => " abc" + +evaluate.sps:8.17-8.31: error: DEBUG EVALUATE: The length argument to LPAD must +be between 0 and 32767. + 8 | DEBUG EVALUATE /lpad('abc', -1). + | ^~~~~~~~~~~~~~~ + +evaluate.sps:8.29-8.30: note: DEBUG EVALUATE: The length argument is -1. + 8 | DEBUG EVALUATE /lpad('abc', -1). + | ^~ + +lpad('abc', -1) => "abc" + +evaluate.sps:9.17-9.34: error: DEBUG EVALUATE: The length argument to LPAD must +be between 0 and 32767. + 9 | DEBUG EVALUATE /lpad('abc', 32768). + | ^~~~~~~~~~~~~~~~~~ + +evaluate.sps:9.29-9.33: note: DEBUG EVALUATE: The length argument is 32768. + 9 | DEBUG EVALUATE /lpad('abc', 32768). + | ^~~~~ + +lpad('abc', 32768) => "abc" + +lpad('abc', $sysmis) => "abc" + +evaluate.sps:12.17-12.36: error: DEBUG EVALUATE: The length argument to LPAD +must be between 0 and 32767. + 12 | DEBUG EVALUATE /lpad('abc', -1, '*'). + | ^~~~~~~~~~~~~~~~~~~~ + +evaluate.sps:12.29-12.30: note: DEBUG EVALUATE: The length argument is -1. + 12 | DEBUG EVALUATE /lpad('abc', -1, '*'). + | ^~ + +lpad('abc', -1, '*') => "abc" + +lpad('abc', 0, '*') => "abc" + +lpad('abc', 2, '*') => "abc" + +lpad('abc', 3, '*') => "abc" + +lpad('abc', 10, '*') => "*******abc" + +lpad('abc', 5, 'de') => "deabc" + +lpad('abc', 6, 'de') => "deabc" + +lpad('abc', 7, 'de') => "dedeabc" + +lpad('abc', 8, 'de') => "dedeabc" + +lpad('abc', 9, 'de') => "dededeabc" + +evaluate.sps:24.17-24.39: error: DEBUG EVALUATE: The length argument to LPAD +must be between 0 and 32767. + 24 | DEBUG EVALUATE /lpad('abc', 32768, '*'). + | ^~~~~~~~~~~~~~~~~~~~~~~ + +evaluate.sps:24.29-24.33: note: DEBUG EVALUATE: The length argument is 32768. + 24 | DEBUG EVALUATE /lpad('abc', 32768, '*'). + | ^~~~~ + +lpad('abc', 32768, '*') => "abc" + +lpad('abc', $sysmis, '*') => "abc" + +lpad('abc', $sysmis, '') => "abc" + +lpad('abc', $sysmis, 'xy') => "abc" + +evaluate.sps:28.17-28.27: error: DEBUG EVALUATE: Function invocation +lpad(number, number) does not match any known function. Candidates are: +LPAD(string, integer) +LPAD(string, integer, string). + 28 | DEBUG EVALUATE /lpad(0, 10). + | ^~~~~~~~~~~ + +lpad(0, 10) => error + +evaluate.sps:29.17-29.34: error: DEBUG EVALUATE: Function invocation +lpad(string, string) does not match any known function. Candidates are: +LPAD(string, integer) +LPAD(string, integer, string). + 29 | DEBUG EVALUATE /lpad('abc', 'def'). + | ^~~~~~~~~~~~~~~~~~ + +lpad('abc', 'def') => error + +evaluate.sps:30.17-30.32: error: DEBUG EVALUATE: Function invocation +lpad(number, number, string) does not match any known function. Candidates +are: +LPAD(string, integer) +LPAD(string, integer, string). + 30 | DEBUG EVALUATE /lpad(0, 10, ' '). + | ^~~~~~~~~~~~~~~~ + +lpad(0, 10, ' ') => error + +evaluate.sps:31.17-31.39: error: DEBUG EVALUATE: Function invocation +lpad(string, string, string) does not match any known function. Candidates +are: +LPAD(string, integer) +LPAD(string, integer, string). + 31 | DEBUG EVALUATE /lpad('abc', 'def', ' '). + | ^~~~~~~~~~~~~~~~~~~~~~~ + +lpad('abc', 'def', ' ') => error + +evaluate.sps:32.17-32.31: error: DEBUG EVALUATE: Function invocation +lpad(string, number, number) does not match any known function. Candidates +are: +LPAD(string, integer) +LPAD(string, integer, string). + 32 | DEBUG EVALUATE /lpad('x', 5, 0). + | ^~~~~~~~~~~~~~~ + +lpad('x', 5, 0) => error + +evaluate.sps:33.17-33.31: error: DEBUG EVALUATE: Function invocation +lpad(string, number, number) does not match any known function. Candidates +are: +LPAD(string, integer) +LPAD(string, integer, string). + 33 | DEBUG EVALUATE /lpad('x', 5, 2). + | ^~~~~~~~~~~~~~~ + +lpad('x', 5, 2) => error +]) +done +AT_CLEANUP + +AT_SETUP([expressions - NUMBER]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +DEBUG EVALUATE /number("123", f3.0). +DEBUG EVALUATE /number(" 123", f3.0). +DEBUG EVALUATE /number("123", f3.1). +DEBUG EVALUATE /number(" ", f3.1). +DEBUG EVALUATE /number("123", a8). +dnl CCA is not an input format: +DEBUG EVALUATE /number("123", cca1.2). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +number("123", f3.0) => 123.00 + +number(" 123", f3.0) => 12.00 + +number("123", f3.1) => 12.30 + +number(" ", f3.1) => sysmis + +evaluate.sps:7.17-7.33: error: DEBUG EVALUATE: Type mismatch invoking +NUMBER(string, num_input_format) as number(string, format). + 7 | DEBUG EVALUATE /number("123", a8). + | ^~~~~~~~~~~~~~~~~ + +number("123", a8) => error + +evaluate.sps:8.17-8.37: error: DEBUG EVALUATE: Type mismatch invoking +NUMBER(string, num_input_format) as number(string, format). + 8 | DEBUG EVALUATE /number("123", cca1.2). + | ^~~~~~~~~~~~~~~~~~~~~ + +number("123", cca1.2) => error +]) +done +AT_CLEANUP + +AT_SETUP([expressions - LTRIM]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +DEBUG EVALUATE /ltrim(' abc'). +DEBUG EVALUATE /rtrim(' abc '). +DEBUG EVALUATE /ltrim('abc'). +* The following string contains a tab. +DEBUG EVALUATE /ltrim(' abc'). +DEBUG EVALUATE /ltrim(' '). +DEBUG EVALUATE /ltrim(''). +DEBUG EVALUATE /ltrim(8). + +DEBUG EVALUATE /ltrim('***abc', '*'). +DEBUG EVALUATE /ltrim('abc', '*'). +DEBUG EVALUATE /ltrim('*abc', '*'). +DEBUG EVALUATE /ltrim('', '*'). + +DEBUG EVALUATE /ltrim('abc', 'xy'). +DEBUG EVALUATE /ltrim('xyabc', 'xy'). +DEBUG EVALUATE /ltrim('xyxyabc', 'xy'). + +DEBUG EVALUATE /ltrim(8, '*'). +DEBUG EVALUATE /ltrim(' x', 8). +DEBUG EVALUATE /ltrim(8, 9). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +ltrim(' abc') => "abc" + +rtrim(' abc ') => " abc" + +ltrim('abc') => "abc" + +ltrim(' abc') => " abc" + +ltrim(' ') => "" + +ltrim('') => "" + +evaluate.sps:10.17-10.24: error: DEBUG EVALUATE: Function invocation +ltrim(number) does not match any known function. Candidates are: +LTRIM(string) +LTRIM(string, string). + 10 | DEBUG EVALUATE /ltrim(8). + | ^~~~~~~~ + +ltrim(8) => error + +ltrim('***abc', '*') => "abc" + +ltrim('abc', '*') => "abc" + +ltrim('*abc', '*') => "abc" + +ltrim('', '*') => "" + +ltrim('abc', 'xy') => "abc" + +ltrim('xyabc', 'xy') => "abc" + +ltrim('xyxyabc', 'xy') => "abc" + +evaluate.sps:21.17-21.29: error: DEBUG EVALUATE: Function invocation +ltrim(number, string) does not match any known function. Candidates are: +LTRIM(string) +LTRIM(string, string). + 21 | DEBUG EVALUATE /ltrim(8, '*'). + | ^~~~~~~~~~~~~ + +ltrim(8, '*') => error + +evaluate.sps:22.17-22.30: error: DEBUG EVALUATE: Function invocation +ltrim(string, number) does not match any known function. Candidates are: +LTRIM(string) +LTRIM(string, string). + 22 | DEBUG EVALUATE /ltrim(' x', 8). + | ^~~~~~~~~~~~~~ + +ltrim(' x', 8) => error + +evaluate.sps:23.17-23.27: error: DEBUG EVALUATE: Function invocation +ltrim(number, number) does not match any known function. Candidates are: +LTRIM(string) +LTRIM(string, string). + 23 | DEBUG EVALUATE /ltrim(8, 9). + | ^~~~~~~~~~~ + +ltrim(8, 9) => error +]) +done +AT_CLEANUP + +AT_SETUP([expressions - RPAD]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [dnl +DEBUG EVALUATE SET opt. + +DEBUG EVALUATE /rpad('abc', 0). +DEBUG EVALUATE /rpad('abc', 2). +DEBUG EVALUATE /rpad('abc', 3). +DEBUG EVALUATE /rpad('abc', 10). + +DEBUG EVALUATE /rpad('abc', -1). +DEBUG EVALUATE /rpad('abc', 32768). +DEBUG EVALUATE /rpad('abc', $sysmis). + +DEBUG EVALUATE /rpad('abc', -1, '*'). +DEBUG EVALUATE /rpad('abc', 0, '*'). +DEBUG EVALUATE /rpad('abc', 2, '*'). +DEBUG EVALUATE /rpad('abc', 3, '*'). +DEBUG EVALUATE /rpad('abc', 10, '*'). + +DEBUG EVALUATE /rpad('abc', 5, 'de'). +DEBUG EVALUATE /rpad('abc', 6, 'de'). +DEBUG EVALUATE /rpad('abc', 7, 'de'). +DEBUG EVALUATE /rpad('abc', 8, 'de'). +DEBUG EVALUATE /rpad('abc', 9, 'de'). + +DEBUG EVALUATE /rpad('abc', 32768, '*'). +DEBUG EVALUATE /rpad('abc', $sysmis, '*'). +DEBUG EVALUATE /rpad('abc', $sysmis, ''). +DEBUG EVALUATE /rpad('abc', $sysmis, 'xy'). +DEBUG EVALUATE /rpad(0, 10). +DEBUG EVALUATE /rpad('abc', 'def'). +DEBUG EVALUATE /rpad(0, 10, ' '). +DEBUG EVALUATE /rpad('abc', 'def', ' '). +DEBUG EVALUATE /rpad('x', 5, 0). +DEBUG EVALUATE /rpad('x', 5, 2). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +rpad('abc', 0) => "abc" + +rpad('abc', 2) => "abc" + +rpad('abc', 3) => "abc" + +rpad('abc', 10) => "abc " + +evaluate.sps:8.17-8.31: error: DEBUG EVALUATE: The length argument to RPAD must +be between 0 and 32767. + 8 | DEBUG EVALUATE /rpad('abc', -1). + | ^~~~~~~~~~~~~~~ + +evaluate.sps:8.29-8.30: note: DEBUG EVALUATE: The length argument is -1. + 8 | DEBUG EVALUATE /rpad('abc', -1). + | ^~ + +rpad('abc', -1) => "abc" + +evaluate.sps:9.17-9.34: error: DEBUG EVALUATE: The length argument to RPAD must +be between 0 and 32767. + 9 | DEBUG EVALUATE /rpad('abc', 32768). + | ^~~~~~~~~~~~~~~~~~ + +evaluate.sps:9.29-9.33: note: DEBUG EVALUATE: The length argument is 32768. + 9 | DEBUG EVALUATE /rpad('abc', 32768). + | ^~~~~ + +rpad('abc', 32768) => "abc" + +rpad('abc', $sysmis) => "abc" + +evaluate.sps:12.17-12.36: error: DEBUG EVALUATE: The length argument to RPAD +must be between 0 and 32767. + 12 | DEBUG EVALUATE /rpad('abc', -1, '*'). + | ^~~~~~~~~~~~~~~~~~~~ + +evaluate.sps:12.29-12.30: note: DEBUG EVALUATE: The length argument is -1. + 12 | DEBUG EVALUATE /rpad('abc', -1, '*'). + | ^~ + +rpad('abc', -1, '*') => "abc" + +rpad('abc', 0, '*') => "abc" + +rpad('abc', 2, '*') => "abc" + +rpad('abc', 3, '*') => "abc" + +rpad('abc', 10, '*') => "abc*******" + +rpad('abc', 5, 'de') => "abcde" + +rpad('abc', 6, 'de') => "abcde" + +rpad('abc', 7, 'de') => "abcdede" + +rpad('abc', 8, 'de') => "abcdede" + +rpad('abc', 9, 'de') => "abcdedede" + +evaluate.sps:24.17-24.39: error: DEBUG EVALUATE: The length argument to RPAD +must be between 0 and 32767. + 24 | DEBUG EVALUATE /rpad('abc', 32768, '*'). + | ^~~~~~~~~~~~~~~~~~~~~~~ + +evaluate.sps:24.29-24.33: note: DEBUG EVALUATE: The length argument is 32768. + 24 | DEBUG EVALUATE /rpad('abc', 32768, '*'). + | ^~~~~ + +rpad('abc', 32768, '*') => "abc" + +rpad('abc', $sysmis, '*') => "abc" + +rpad('abc', $sysmis, '') => "abc" + +rpad('abc', $sysmis, 'xy') => "abc" + +evaluate.sps:28.17-28.27: error: DEBUG EVALUATE: Function invocation +rpad(number, number) does not match any known function. Candidates are: +RPAD(string, integer) +RPAD(string, integer, string). + 28 | DEBUG EVALUATE /rpad(0, 10). + | ^~~~~~~~~~~ + +rpad(0, 10) => error + +evaluate.sps:29.17-29.34: error: DEBUG EVALUATE: Function invocation +rpad(string, string) does not match any known function. Candidates are: +RPAD(string, integer) +RPAD(string, integer, string). + 29 | DEBUG EVALUATE /rpad('abc', 'def'). + | ^~~~~~~~~~~~~~~~~~ + +rpad('abc', 'def') => error + +evaluate.sps:30.17-30.32: error: DEBUG EVALUATE: Function invocation +rpad(number, number, string) does not match any known function. Candidates +are: +RPAD(string, integer) +RPAD(string, integer, string). + 30 | DEBUG EVALUATE /rpad(0, 10, ' '). + | ^~~~~~~~~~~~~~~~ + +rpad(0, 10, ' ') => error + +evaluate.sps:31.17-31.39: error: DEBUG EVALUATE: Function invocation +rpad(string, string, string) does not match any known function. Candidates +are: +RPAD(string, integer) +RPAD(string, integer, string). + 31 | DEBUG EVALUATE /rpad('abc', 'def', ' '). + | ^~~~~~~~~~~~~~~~~~~~~~~ + +rpad('abc', 'def', ' ') => error + +evaluate.sps:32.17-32.31: error: DEBUG EVALUATE: Function invocation +rpad(string, number, number) does not match any known function. Candidates +are: +RPAD(string, integer) +RPAD(string, integer, string). + 32 | DEBUG EVALUATE /rpad('x', 5, 0). + | ^~~~~~~~~~~~~~~ + +rpad('x', 5, 0) => error + +evaluate.sps:33.17-33.31: error: DEBUG EVALUATE: Function invocation +rpad(string, number, number) does not match any known function. Candidates +are: +RPAD(string, integer) +RPAD(string, integer, string). + 33 | DEBUG EVALUATE /rpad('x', 5, 2). + | ^~~~~~~~~~~~~~~ + +rpad('x', 5, 2) => error +]) +done +AT_CLEANUP + +AT_SETUP([expressions - RTRIM]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +DEBUG EVALUATE /rtrim('abc '). +DEBUG EVALUATE /rtrim(' abc '). +DEBUG EVALUATE /rtrim('abc'). +* The following string contains a tab. +DEBUG EVALUATE /rtrim('abc '). +DEBUG EVALUATE /rtrim(' '). +DEBUG EVALUATE /rtrim(''). +DEBUG EVALUATE /rtrim(8). + +DEBUG EVALUATE /rtrim('abc***', '*'). +DEBUG EVALUATE /rtrim('abc', '*'). +DEBUG EVALUATE /rtrim('abc*', '*'). +DEBUG EVALUATE /rtrim('', '*'). + +DEBUG EVALUATE /rtrim('abc', 'xy'). +DEBUG EVALUATE /rtrim('abcxy', 'xy'). +DEBUG EVALUATE /rtrim('abcxyxy', 'xy'). + +DEBUG EVALUATE /rtrim(8, '*'). +DEBUG EVALUATE /rtrim('x ', 8). +DEBUG EVALUATE /rtrim(8, 9). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +rtrim('abc ') => "abc" + +rtrim(' abc ') => " abc" + +rtrim('abc') => "abc" + +rtrim('abc ') => "abc " + +rtrim(' ') => "" + +rtrim('') => "" + +evaluate.sps:10.17-10.24: error: DEBUG EVALUATE: Function invocation +rtrim(number) does not match any known function. Candidates are: +RTRIM(string) +RTRIM(string, string). + 10 | DEBUG EVALUATE /rtrim(8). + | ^~~~~~~~ + +rtrim(8) => error + +rtrim('abc***', '*') => "abc" + +rtrim('abc', '*') => "abc" + +rtrim('abc*', '*') => "abc" + +rtrim('', '*') => "" + +rtrim('abc', 'xy') => "abc" + +rtrim('abcxy', 'xy') => "abc" + +rtrim('abcxyxy', 'xy') => "abc" + +evaluate.sps:21.17-21.29: error: DEBUG EVALUATE: Function invocation +rtrim(number, string) does not match any known function. Candidates are: +RTRIM(string) +RTRIM(string, string). + 21 | DEBUG EVALUATE /rtrim(8, '*'). + | ^~~~~~~~~~~~~ + +rtrim(8, '*') => error + +evaluate.sps:22.17-22.30: error: DEBUG EVALUATE: Function invocation +rtrim(string, number) does not match any known function. Candidates are: +RTRIM(string) +RTRIM(string, string). + 22 | DEBUG EVALUATE /rtrim('x ', 8). + | ^~~~~~~~~~~~~~ + +rtrim('x ', 8) => error + +evaluate.sps:23.17-23.27: error: DEBUG EVALUATE: Function invocation +rtrim(number, number) does not match any known function. Candidates are: +RTRIM(string) +RTRIM(string, string). + 23 | DEBUG EVALUATE /rtrim(8, 9). + | ^~~~~~~~~~~ + +rtrim(8, 9) => error +]) +done +AT_CLEANUP + +AT_SETUP([expressions - STRING]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +DEBUG EVALUATE /string(123.56, f5.1). +DEBUG EVALUATE /string($sysmis, f5.1). +DEBUG EVALUATE /string("abc", A5). +dnl E has a minimum width of 6 on output: +DEBUG EVALUATE /string(123, e1). +DEBUG EVALUATE /string(123, e6.0). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +]) +done +AT_CLEANUP + +AT_SETUP([expressions - STRUNC]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +DEBUG EVALUATE /strunc('a c ', 9). +DEBUG EVALUATE /strunc('a c ', 7). +DEBUG EVALUATE /strunc('a c ', 6). +DEBUG EVALUATE /strunc('a c ', 5). +DEBUG EVALUATE /strunc('a c ', 4). +DEBUG EVALUATE /strunc('a c ', 3). +DEBUG EVALUATE /strunc('a c ', 2). +DEBUG EVALUATE /strunc('a c ', 1). +DEBUG EVALUATE /strunc('a c ', 0). +DEBUG EVALUATE /strunc('a c ', -1). +DEBUG EVALUATE /strunc('a c ', $sysmis). +DEBUG EVALUATE /strunc(' abc ', 9). +DEBUG EVALUATE /strunc(' abc ', 8). +DEBUG EVALUATE /strunc(' abc ', 7). +DEBUG EVALUATE /strunc(' abc ', 6). +DEBUG EVALUATE /strunc(' abc ', 5). +DEBUG EVALUATE /strunc(' abc ', 4). +DEBUG EVALUATE /strunc(' abc ', 3). +DEBUG EVALUATE /strunc(' abc ', 2). +DEBUG EVALUATE /strunc(' abc ', 1). +DEBUG EVALUATE /strunc(' abc ', -1). +DEBUG EVALUATE /strunc(' abc ', $sysmis). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +]) +done +AT_CLEANUP + +AT_SETUP([expressions - SUBSTR]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +DEBUG EVALUATE /substr('abcdefgh', -5). +DEBUG EVALUATE /substr('abcdefgh', 0). +DEBUG EVALUATE /substr('abcdefgh', 1). +DEBUG EVALUATE /substr('abcdefgh', 3). +DEBUG EVALUATE /substr('abcdefgh', 5). +DEBUG EVALUATE /substr('abcdefgh', 6). +DEBUG EVALUATE /substr('abcdefgh', 7). +DEBUG EVALUATE /substr('abcdefgh', 8). +DEBUG EVALUATE /substr('abcdefgh', 9). +DEBUG EVALUATE /substr('abcdefgh', 10). +DEBUG EVALUATE /substr('abcdefgh', 20). +DEBUG EVALUATE /substr('abcdefgh', $sysmis). +DEBUG EVALUATE /substr(0, 10). +DEBUG EVALUATE /substr('abcd', 'abc'). +DEBUG EVALUATE /substr(0, 'abc'). + +DEBUG EVALUATE /substr('abcdefgh', 0, 0). +DEBUG EVALUATE /substr('abcdefgh', 3, 0). +DEBUG EVALUATE /substr('abcdefgh', 5, 0). +DEBUG EVALUATE /substr('abcdefgh', 9, 0). +DEBUG EVALUATE /substr('abcdefgh', 0, 1). +DEBUG EVALUATE /substr('abcdefgh', 0, 5). +DEBUG EVALUATE /substr('abcdefgh', 1, 8). +DEBUG EVALUATE /substr('abcdefgh', 1, 10). +DEBUG EVALUATE /substr('abcdefgh', 1, 20). +DEBUG EVALUATE /substr('abcdefgh', 3, 4). +DEBUG EVALUATE /substr('abcdefgh', 5, 2). +DEBUG EVALUATE /substr('abcdefgh', 6, 1). +DEBUG EVALUATE /substr('abcdefgh', 7, 10). +DEBUG EVALUATE /substr('abcdefgh', 8, 1). +DEBUG EVALUATE /substr('abcdefgh', 8, 2). +DEBUG EVALUATE /substr('abcdefgh', 9, 11). +DEBUG EVALUATE /substr('abcdefgh', 10, 52). +DEBUG EVALUATE /substr('abcdefgh', 20, 1). +DEBUG EVALUATE /substr('abcdefgh', $sysmis, 2). +DEBUG EVALUATE /substr('abcdefgh', 9, $sysmis). +DEBUG EVALUATE /substr('abcdefgh', $sysmis, $sysmis). +DEBUG EVALUATE /substr('abc', 1, 'x'). +DEBUG EVALUATE /substr(0, 10, 1). +DEBUG EVALUATE /substr(0, 10, 'x'). +DEBUG EVALUATE /substr('abcd', 'abc', 0). +DEBUG EVALUATE /substr('abcd', 'abc', 'j'). +DEBUG EVALUATE /substr(0, 'abc', 4). +DEBUG EVALUATE /substr(0, 'abc', 'k'). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +]) +done +AT_CLEANUP + +AT_SETUP([expressions - UPCASE]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +DEBUG EVALUATE /upcase('abcdefghijklmnopqrstuvwxyz!@%&*089'). +DEBUG EVALUATE /upcase(''). +DEBUG EVALUATE /upcase(1). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +]) +done +AT_CLEANUP + +AT_SETUP([expressions - TIME.DAYS]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +DEBUG EVALUATE /time.days(1). +DEBUG EVALUATE /time.days(-1). +DEBUG EVALUATE /time.days(0.5). +DEBUG EVALUATE /time.days('x'). +DEBUG EVALUATE /time.days($sysmis). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +]) +done +AT_CLEANUP + +AT_SETUP([expressions - TIME.HMS]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +DEBUG EVALUATE /time.hms(4,50,38). +DEBUG EVALUATE /time.hms(12,31,35). +DEBUG EVALUATE /time.hms(12,47,53). +DEBUG EVALUATE /time.hms(1,26,0). +DEBUG EVALUATE /time.hms(20,58,11). +DEBUG EVALUATE /time.hms(7,36,5). +DEBUG EVALUATE /time.hms(15,43,49). +DEBUG EVALUATE /time.hms(4,25,9). +DEBUG EVALUATE /time.hms(6,49,27). +DEBUG EVALUATE /time.hms(2,57,52). +DEBUG EVALUATE /time.hms(16,45,44). +DEBUG EVALUATE /time.hms(21,30,57). +DEBUG EVALUATE /time.hms(22,30,4). +DEBUG EVALUATE /time.hms(1,56,51). +DEBUG EVALUATE /time.hms(5, 6, 7). +DEBUG EVALUATE /time.hms(5, 6, 0). +DEBUG EVALUATE /time.hms(5, 0, 7). +DEBUG EVALUATE /time.hms(0, 6, 7). +DEBUG EVALUATE /time.hms(-5, 6, -7). +DEBUG EVALUATE /time.hms(-5, 5, -7). +DEBUG EVALUATE /time.hms($sysmis, 6, 7). +DEBUG EVALUATE /time.hms(5, $sysmis, 7). +DEBUG EVALUATE /time.hms(5, $sysmis, 7). +DEBUG EVALUATE /time.hms($sysmis, $sysmis, 7). +DEBUG EVALUATE /time.hms(5, $sysmis, $sysmis). +DEBUG EVALUATE /time.hms($sysmis, $sysmis, 7). +DEBUG EVALUATE /time.hms($sysmis, $sysmis, $sysmis). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +]) +done +AT_CLEANUP + +AT_SETUP([expressions - CTIME.*]) +AT_KEYWORDS([expression expressions evaluate ctime]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +DEBUG EVALUATE /ctime.days(106272). +DEBUG EVALUATE /ctime.hours(106272). +DEBUG EVALUATE /ctime.minutes(106272). +DEBUG EVALUATE /ctime.seconds(106272). +DEBUG EVALUATE /ctime.days(-106272). +DEBUG EVALUATE /ctime.hours(-106272). +DEBUG EVALUATE /ctime.minutes(-106272). +DEBUG EVALUATE /ctime.seconds(-106272). +DEBUG EVALUATE /ctime.days($sysmis). +DEBUG EVALUATE /ctime.hours($sysmis). +DEBUG EVALUATE /ctime.minutes($sysmis). +DEBUG EVALUATE /ctime.seconds($sysmis). +DEBUG EVALUATE /ctime.days('a'). +DEBUG EVALUATE /ctime.hours('b'). +DEBUG EVALUATE /ctime.minutes('c'). +DEBUG EVALUATE /ctime.seconds('d'). + +DEBUG EVALUATE /ctime.days(date.dmy(15,10,1582)). +DEBUG EVALUATE /ctime.days(date.dmy(6,9,1719)). +DEBUG EVALUATE /ctime.days(date.dmy(24,1,1583)). +DEBUG EVALUATE /ctime.days(date.dmy(14,12,1585)). +DEBUG EVALUATE /ctime.days(date.dmy(26,11,1621)). +DEBUG EVALUATE /ctime.days(date.dmy(25,12,1821)). +DEBUG EVALUATE /ctime.days(date.dmy(3,12,1882)). +DEBUG EVALUATE /ctime.days(date.dmy(6,4,2002)). +DEBUG EVALUATE /ctime.days(date.dmy(19,12,1999)). +DEBUG EVALUATE /ctime.days(date.dmy(1,10,1978)). +DEBUG EVALUATE /ctime.days(date.dmy(0,10,1978)). +DEBUG EVALUATE /ctime.days(date.dmy(32,10,1978)). +DEBUG EVALUATE /ctime.days(date.dmy(31,0,1978)). +DEBUG EVALUATE /ctime.days(date.dmy(31,13,1978)). +DEBUG EVALUATE /ctime.days(date.dmy($sysmis,10,1978)). +DEBUG EVALUATE /ctime.days(date.dmy(31,$sysmis,1978)). +DEBUG EVALUATE /ctime.days(date.dmy(31,10,$sysmis)). +DEBUG EVALUATE /ctime.days(date.dmy($sysmis,$sysmis,1978)). +DEBUG EVALUATE /ctime.days(date.dmy(31,$sysmis,$sysmis)). +DEBUG EVALUATE /ctime.days(date.dmy($sysmis,10,$sysmis)). +DEBUG EVALUATE /ctime.days(date.dmy($sysmis,$sysmis,$sysmis)). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +]) +done +AT_CLEANUP + +AT_SETUP([expressions - DATE.DMY]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +DEBUG EVALUATE /date.dmy('a',1,2). +DEBUG EVALUATE /date.dmy(1,'a',2). +DEBUG EVALUATE /date.dmy(1,2,'a'). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +]) +done +AT_CLEANUP + +AT_SETUP([expressions - YRMOD]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +dnl FIXME: check out-of-range and nearly out-of-range values +DEBUG EVALUATE /yrmoda(1582,10,15). +DEBUG EVALUATE /yrmoda(1719,9,6). +DEBUG EVALUATE /yrmoda(1583,1,24). +DEBUG EVALUATE /yrmoda(1585,12,14). +DEBUG EVALUATE /yrmoda(1621,11,26). +DEBUG EVALUATE /yrmoda(1821,12,25). +DEBUG EVALUATE /yrmoda(1882,12,3). +DEBUG EVALUATE /yrmoda(2002,4,6). +DEBUG EVALUATE /yrmoda(1999,12,19). +DEBUG EVALUATE /yrmoda(1978,10,1). +DEBUG EVALUATE /yrmoda(1978,10,0). +DEBUG EVALUATE /yrmoda(1978,10,32). +DEBUG EVALUATE /yrmoda(1978,0,31). +DEBUG EVALUATE /yrmoda(1978,13,31). +DEBUG EVALUATE /yrmoda(1978,10,$sysmis). +DEBUG EVALUATE /yrmoda(1978,$sysmis,31). +DEBUG EVALUATE /yrmoda($sysmis,10,31). +DEBUG EVALUATE /yrmoda(1978,$sysmis,$sysmis). +DEBUG EVALUATE /yrmoda($sysmis,$sysmis,31). +DEBUG EVALUATE /yrmoda($sysmis,10,$sysmis). +DEBUG EVALUATE /yrmoda($sysmis,$sysmis,$sysmis). +DEBUG EVALUATE /yrmoda('a',1,2). +DEBUG EVALUATE /yrmoda(1,'a',2). +DEBUG EVALUATE /yrmoda(1,2,'a'). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +]) +done +AT_CLEANUP + +AT_SETUP([expressions - DATE.MDY]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +dnl FIXME: check out-of-range and nearly out-of-range values +DEBUG EVALUATE /ctime.days(date.mdy(6,10,1648)) + 577735. +DEBUG EVALUATE /ctime.days(date.mdy(6,30,1680)) + 577735. +DEBUG EVALUATE /ctime.days(date.mdy(7,24,1716)) + 577735. +DEBUG EVALUATE /ctime.days(date.mdy(6,19,1768)) + 577735. +DEBUG EVALUATE /ctime.days(date.mdy(8,2,1819)) + 577735. +DEBUG EVALUATE /ctime.days(date.mdy(3,27,1839)) + 577735. +DEBUG EVALUATE /ctime.days(date.mdy(4,19,1903)) + 577735. +DEBUG EVALUATE /ctime.days(date.mdy(8,25,1929)) + 577735. +DEBUG EVALUATE /ctime.days(date.mdy(9,29,1941)) + 577735. +DEBUG EVALUATE /ctime.days(date.mdy(4,19,1943)) + 577735. +DEBUG EVALUATE /ctime.days(date.mdy(10,7,1943)) + 577735. +DEBUG EVALUATE /ctime.days(date.mdy(3,17,1992)) + 577735. +DEBUG EVALUATE /ctime.days(date.mdy(2,25,1996)) + 577735. +DEBUG EVALUATE /ctime.days(date.mdy(11,10,2038)) + 577735. +DEBUG EVALUATE /ctime.days(date.mdy(7,18,2094)) + 577735. +dnl FIXME: check out-of-range and nearly out-of-range values +dnl +DEBUG EVALUATE /ctime.days(date.mdy(10,15,1582)). +DEBUG EVALUATE /ctime.days(date.mdy(9,6,1719)). +DEBUG EVALUATE /ctime.days(date.mdy(1,24,1583)). +DEBUG EVALUATE /ctime.days(date.mdy(12,14,1585)). +DEBUG EVALUATE /ctime.days(date.mdy(11,26,1621)). +DEBUG EVALUATE /ctime.days(date.mdy(12,25,1821)). +DEBUG EVALUATE /ctime.days(date.mdy(12,3,1882)). +DEBUG EVALUATE /ctime.days(date.mdy(4,6,2002)). +DEBUG EVALUATE /ctime.days(date.mdy(12,19,1999)). +DEBUG EVALUATE /ctime.days(date.mdy(10,1,1978)). +DEBUG EVALUATE /ctime.days(date.mdy(10,0,1978)). +DEBUG EVALUATE /ctime.days(date.mdy(10,32,1978)). +DEBUG EVALUATE /ctime.days(date.mdy(0,31,1978)). +DEBUG EVALUATE /ctime.days(date.mdy(13,31,1978)). +DEBUG EVALUATE /ctime.days(date.mdy(10,$sysmis,1978)). +DEBUG EVALUATE /ctime.days(date.mdy($sysmis,31,1978)). +DEBUG EVALUATE /ctime.days(date.mdy(10,31,$sysmis)). +DEBUG EVALUATE /ctime.days(date.mdy($sysmis,$sysmis,1978)). +DEBUG EVALUATE /ctime.days(date.mdy($sysmis,31,$sysmis)). +DEBUG EVALUATE /ctime.days(date.mdy(10,$sysmis,$sysmis)). +DEBUG EVALUATE /ctime.days(date.mdy($sysmis,$sysmis,$sysmis)). +DEBUG EVALUATE /date.mdy('a',1,2). +DEBUG EVALUATE /date.mdy(1,'a',2). +DEBUG EVALUATE /date.mdy(1,2,'a'). +DEBUG EVALUATE /ctime.days(date.mdy(0,0,0)). +DEBUG EVALUATE /ctime.days(date.mdy(0,0,999)). +DEBUG EVALUATE /date.mdy(1,1,1582). +DEBUG EVALUATE /date.mdy(10,14,1582). +DEBUG EVALUATE /date.mdy(10,15,1582). +]) +done +AT_CLEANUP + +AT_SETUP([expressions - DATE.MOYR]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +DEBUG EVALUATE /ctime.days(date.moyr(1,2000)). +DEBUG EVALUATE /ctime.days(date.moyr(2,2000)). +DEBUG EVALUATE /ctime.days(date.moyr(3,2000)). +DEBUG EVALUATE /ctime.days(date.moyr(4,2000)). +DEBUG EVALUATE /ctime.days(date.moyr(5,2000)). +DEBUG EVALUATE /ctime.days(date.moyr(13,2000)). +DEBUG EVALUATE /ctime.days(date.moyr(14,2000)). +DEBUG EVALUATE /ctime.days(date.moyr($sysmis,2000)). +DEBUG EVALUATE /ctime.days(date.moyr(1,$sysmis)). +DEBUG EVALUATE /ctime.days(date.moyr($sysmis,$sysmis)). +DEBUG EVALUATE /date.moyr('a',2000). +DEBUG EVALUATE /date.moyr(5,'a'). +DEBUG EVALUATE /date.moyr('a','b'). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +]) +done +AT_CLEANUP + +AT_SETUP([expressions - DATE.QYR]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +DEBUG EVALUATE /ctime.days(date.qyr(1,2000)). +DEBUG EVALUATE /ctime.days(date.qyr(2,2000)). +DEBUG EVALUATE /ctime.days(date.qyr(5,2000)). +DEBUG EVALUATE /ctime.days(date.qyr(6,2000)). +DEBUG EVALUATE /ctime.days(date.qyr($sysmis,2000)). +DEBUG EVALUATE /ctime.days(date.qyr(1,$sysmis)). +DEBUG EVALUATE /ctime.days(date.qyr($sysmis,$sysmis)). +DEBUG EVALUATE /date.qyr('a',2000). +DEBUG EVALUATE /date.qyr(5,'a'). +DEBUG EVALUATE /date.qyr('a','b'). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +]) +done +AT_CLEANUP + +AT_SETUP([expressions - DATE.WKYR]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +DEBUG EVALUATE /ctime.days(date.wkyr(1,2000)). +DEBUG EVALUATE /ctime.days(date.wkyr(15,1999)). +DEBUG EVALUATE /ctime.days(date.wkyr(36,1999)). +DEBUG EVALUATE /ctime.days(date.wkyr(54,1999)). +DEBUG EVALUATE /ctime.days(date.wkyr($sysmis,1999)). +DEBUG EVALUATE /ctime.days(date.wkyr(1,$sysmis)). +DEBUG EVALUATE /ctime.days(date.wkyr($sysmis,$sysmis)). +DEBUG EVALUATE /date.wkyr('a',1999). +DEBUG EVALUATE /date.wkyr(5,'a'). +DEBUG EVALUATE /date.wkyr('a','b'). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +]) +done +AT_CLEANUP + +AT_SETUP([expressions - DATE.YRDAY]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +DEBUG EVALUATE /ctime.days(date.yrday(2000,1)). +DEBUG EVALUATE /ctime.days(date.yrday(2000,100)). +DEBUG EVALUATE /ctime.days(date.yrday(2000,253)). +DEBUG EVALUATE /ctime.days(date.yrday(2000,500)). +DEBUG EVALUATE /ctime.days(date.yrday(2000,-100)). +DEBUG EVALUATE /ctime.days(date.yrday(1999,$sysmis)). +DEBUG EVALUATE /ctime.days(date.yrday($sysmis,1)). +DEBUG EVALUATE /ctime.days(date.yrday($sysmis,$sysmis)). +DEBUG EVALUATE /date.yrday(1999,'a'). +DEBUG EVALUATE /date.yrday('a',5). +DEBUG EVALUATE /date.yrday('a','b'). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +]) +done +AT_CLEANUP + +AT_SETUP([expressions - XDATE.DATE]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +DEBUG EVALUATE /xdate.date(date.mdy(6,10,1648) + time.hms(0,0,0)) / 86400. +DEBUG EVALUATE /xdate.date(date.mdy(6,30,1680) + time.hms(4,50,38)) / 86400. +DEBUG EVALUATE /xdate.date(date.mdy(7,24,1716) + time.hms(12,31,35)) / 86400. +DEBUG EVALUATE /xdate.date(date.mdy(6,19,1768) + time.hms(12,47,53)) / 86400. +DEBUG EVALUATE /xdate.date(date.mdy(8,2,1819) + time.hms(1,26,0)) / 86400. +DEBUG EVALUATE /xdate.date(date.mdy(3,27,1839) + time.hms(20,58,11)) / 86400. +DEBUG EVALUATE /xdate.date(date.mdy(4,19,1903) + time.hms(7,36,5)) / 86400. +DEBUG EVALUATE /xdate.date(date.mdy(8,25,1929) + time.hms(15,43,49)) / 86400. +DEBUG EVALUATE /xdate.date(date.mdy(9,29,1941) + time.hms(4,25,9)) / 86400. +DEBUG EVALUATE /xdate.date(date.mdy(4,19,1943) + time.hms(6,49,27)) / 86400. +DEBUG EVALUATE /xdate.date(date.mdy(10,7,1943) + time.hms(2,57,52)) / 86400. +DEBUG EVALUATE /xdate.date(date.mdy(3,17,1992) + time.hms(16,45,44)) / 86400. +DEBUG EVALUATE /xdate.date(date.mdy(2,25,1996) + time.hms(21,30,57)) / 86400. +DEBUG EVALUATE /xdate.date(date.mdy(9,29,1941) + time.hms(4,25,9)) / 86400. +DEBUG EVALUATE /xdate.date(date.mdy(4,19,43) + time.hms(6,49,27)) / 86400. +DEBUG EVALUATE /xdate.date(date.mdy(10,7,43) + time.hms(2,57,52)) / 86400. +DEBUG EVALUATE /xdate.date(date.mdy(3,17,92) + time.hms(16,45,44)) / 86400. +DEBUG EVALUATE /xdate.date(date.mdy(2,25,96) + time.hms(21,30,57)) / 86400. +DEBUG EVALUATE /xdate.date(date.mdy(11,10,2038) + time.hms(22,30,4)) / 86400. +DEBUG EVALUATE /xdate.date(date.mdy(7,18,2094) + time.hms(1,56,51)) / 86400. +DEBUG EVALUATE /xdate.date(123.4). +DEBUG EVALUATE /xdate.date(''). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +]) +done +AT_CLEANUP + +AT_SETUP([expressions - XDATE.HOUR]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +DEBUG EVALUATE /xdate.hour(date.mdy(6,10,1648) + time.hms(0,0,0)). +DEBUG EVALUATE /xdate.hour(date.mdy(6,30,1680) + time.hms(4,50,38)). +DEBUG EVALUATE /xdate.hour(date.mdy(7,24,1716) + time.hms(12,31,35)). +DEBUG EVALUATE /xdate.hour(date.mdy(6,19,1768) + time.hms(12,47,53)). +DEBUG EVALUATE /xdate.hour(date.mdy(8,2,1819) + time.hms(1,26,0)). +DEBUG EVALUATE /xdate.hour(date.mdy(3,27,1839) + time.hms(20,58,11)). +DEBUG EVALUATE /xdate.hour(date.mdy(4,19,1903) + time.hms(7,36,5)). +DEBUG EVALUATE /xdate.hour(date.mdy(8,25,1929) + time.hms(15,43,49)). +DEBUG EVALUATE /xdate.hour(date.mdy(9,29,1941) + time.hms(4,25,9)). +DEBUG EVALUATE /xdate.hour(date.mdy(4,19,1943) + time.hms(6,49,27)). +DEBUG EVALUATE /xdate.hour(date.mdy(10,7,1943) + time.hms(2,57,52)). +DEBUG EVALUATE /xdate.hour(date.mdy(3,17,1992) + time.hms(16,45,44)). +DEBUG EVALUATE /xdate.hour(date.mdy(2,25,1996) + time.hms(21,30,57)). +DEBUG EVALUATE /xdate.hour(date.mdy(9,29,1941) + time.hms(4,25,9)). +DEBUG EVALUATE /xdate.hour(date.mdy(4,19,43) + time.hms(6,49,27)). +DEBUG EVALUATE /xdate.hour(date.mdy(10,7,43) + time.hms(2,57,52)). +DEBUG EVALUATE /xdate.hour(date.mdy(3,17,92) + time.hms(16,45,44)). +DEBUG EVALUATE /xdate.hour(date.mdy(2,25,96) + time.hms(21,30,57)). +DEBUG EVALUATE /xdate.hour(date.mdy(11,10,2038) + time.hms(22,30,4)). +DEBUG EVALUATE /xdate.hour(date.mdy(7,18,2094) + time.hms(1,56,51)). +DEBUG EVALUATE /xdate.hour(-1). +DEBUG EVALUATE /xdate.hour(1). +DEBUG EVALUATE /xdate.hour($sysmis). +DEBUG EVALUATE /xdate.hour(''). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +]) +done +AT_CLEANUP + +AT_SETUP([expressions - XDATE.JDAY]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +DEBUG EVALUATE /xdate.jday(date.mdy(6,10,1648) + time.hms(0,0,0)). +DEBUG EVALUATE /xdate.jday(date.mdy(6,30,1680) + time.hms(4,50,38)). +DEBUG EVALUATE /xdate.jday(date.mdy(7,24,1716) + time.hms(12,31,35)). +DEBUG EVALUATE /xdate.jday(date.mdy(6,19,1768) + time.hms(12,47,53)). +DEBUG EVALUATE /xdate.jday(date.mdy(8,2,1819) + time.hms(1,26,0)). +DEBUG EVALUATE /xdate.jday(date.mdy(3,27,1839) + time.hms(20,58,11)). +DEBUG EVALUATE /xdate.jday(date.mdy(4,19,1903) + time.hms(7,36,5)). +DEBUG EVALUATE /xdate.jday(date.mdy(8,25,1929) + time.hms(15,43,49)). +DEBUG EVALUATE /xdate.jday(date.mdy(9,29,1941) + time.hms(4,25,9)). +DEBUG EVALUATE /xdate.jday(date.mdy(4,19,1943) + time.hms(6,49,27)). +DEBUG EVALUATE /xdate.jday(date.mdy(10,7,1943) + time.hms(2,57,52)). +DEBUG EVALUATE /xdate.jday(date.mdy(3,17,1992) + time.hms(16,45,44)). +DEBUG EVALUATE /xdate.jday(date.mdy(2,25,1996) + time.hms(21,30,57)). +DEBUG EVALUATE /xdate.jday(date.mdy(9,29,1941) + time.hms(4,25,9)). +DEBUG EVALUATE /xdate.jday(date.mdy(4,19,43) + time.hms(6,49,27)). +DEBUG EVALUATE /xdate.jday(date.mdy(10,7,43) + time.hms(2,57,52)). +DEBUG EVALUATE /xdate.jday(date.mdy(3,17,92) + time.hms(16,45,44)). +DEBUG EVALUATE /xdate.jday(date.mdy(2,25,96) + time.hms(21,30,57)). +DEBUG EVALUATE /xdate.jday(date.mdy(11,10,2038) + time.hms(22,30,4)). +DEBUG EVALUATE /xdate.jday(date.mdy(7,18,2094) + time.hms(1,56,51)). +DEBUG EVALUATE /xdate.jday(0). +DEBUG EVALUATE /xdate.jday(1). +DEBUG EVALUATE /xdate.jday(86400). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +]) +done +AT_CLEANUP + +AT_SETUP([expressions - XDATE.MDAY]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +DEBUG EVALUATE /xdate.mday(date.mdy(6,10,1648) + time.hms(0,0,0)). +DEBUG EVALUATE /xdate.mday(date.mdy(6,30,1680) + time.hms(4,50,38)). +DEBUG EVALUATE /xdate.mday(date.mdy(7,24,1716) + time.hms(12,31,35)). +DEBUG EVALUATE /xdate.mday(date.mdy(6,19,1768) + time.hms(12,47,53)). +DEBUG EVALUATE /xdate.mday(date.mdy(8,2,1819) + time.hms(1,26,0)). +DEBUG EVALUATE /xdate.mday(date.mdy(3,27,1839) + time.hms(20,58,11)). +DEBUG EVALUATE /xdate.mday(date.mdy(4,19,1903) + time.hms(7,36,5)). +DEBUG EVALUATE /xdate.mday(date.mdy(8,25,1929) + time.hms(15,43,49)). +DEBUG EVALUATE /xdate.mday(date.mdy(9,29,1941) + time.hms(4,25,9)). +DEBUG EVALUATE /xdate.mday(date.mdy(4,19,1943) + time.hms(6,49,27)). +DEBUG EVALUATE /xdate.mday(date.mdy(10,7,1943) + time.hms(2,57,52)). +DEBUG EVALUATE /xdate.mday(date.mdy(3,17,1992) + time.hms(16,45,44)). +DEBUG EVALUATE /xdate.mday(date.mdy(2,25,1996) + time.hms(21,30,57)). +DEBUG EVALUATE /xdate.mday(date.mdy(9,29,1941) + time.hms(4,25,9)). +DEBUG EVALUATE /xdate.mday(date.mdy(4,19,43) + time.hms(6,49,27)). +DEBUG EVALUATE /xdate.mday(date.mdy(10,7,43) + time.hms(2,57,52)). +DEBUG EVALUATE /xdate.mday(date.mdy(3,17,92) + time.hms(16,45,44)). +DEBUG EVALUATE /xdate.mday(date.mdy(2,25,96) + time.hms(21,30,57)). +DEBUG EVALUATE /xdate.mday(date.mdy(11,10,2038) + time.hms(22,30,4)). +DEBUG EVALUATE /xdate.mday(date.mdy(7,18,2094) + time.hms(1,56,51)). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +]) +done +AT_CLEANUP + +AT_SETUP([expressions - XDATE.MINUTE]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +DEBUG EVALUATE /xdate.minute(date.mdy(6,10,1648) + time.hms(0,0,0)). +DEBUG EVALUATE /xdate.minute(date.mdy(6,30,1680) + time.hms(4,50,38)). +DEBUG EVALUATE /xdate.minute(date.mdy(7,24,1716) + time.hms(12,31,35)). +DEBUG EVALUATE /xdate.minute(date.mdy(6,19,1768) + time.hms(12,47,53)). +DEBUG EVALUATE /xdate.minute(date.mdy(8,2,1819) + time.hms(1,26,0)). +DEBUG EVALUATE /xdate.minute(date.mdy(3,27,1839) + time.hms(20,58,11)). +DEBUG EVALUATE /xdate.minute(date.mdy(4,19,1903) + time.hms(7,36,5)). +DEBUG EVALUATE /xdate.minute(date.mdy(8,25,1929) + time.hms(15,43,49)). +DEBUG EVALUATE /xdate.minute(date.mdy(9,29,1941) + time.hms(4,25,9)). +DEBUG EVALUATE /xdate.minute(date.mdy(4,19,1943) + time.hms(6,49,27)). +DEBUG EVALUATE /xdate.minute(date.mdy(10,7,1943) + time.hms(2,57,52)). +DEBUG EVALUATE /xdate.minute(date.mdy(3,17,1992) + time.hms(16,45,44)). +DEBUG EVALUATE /xdate.minute(date.mdy(2,25,1996) + time.hms(21,30,57)). +DEBUG EVALUATE /xdate.minute(date.mdy(9,29,1941) + time.hms(4,25,9)). +DEBUG EVALUATE /xdate.minute(date.mdy(4,19,43) + time.hms(6,49,27)). +DEBUG EVALUATE /xdate.minute(date.mdy(10,7,43) + time.hms(2,57,52)). +DEBUG EVALUATE /xdate.minute(date.mdy(3,17,92) + time.hms(16,45,44)). +DEBUG EVALUATE /xdate.minute(date.mdy(2,25,96) + time.hms(21,30,57)). +DEBUG EVALUATE /xdate.minute(date.mdy(11,10,2038) + time.hms(22,30,4)). +DEBUG EVALUATE /xdate.minute(date.mdy(7,18,2094) + time.hms(1,56,51)). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +]) +done +AT_CLEANUP + +AT_SETUP([expressions - XDATE.MONTH]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +DEBUG EVALUATE /xdate.month(date.mdy(6,10,1648) + time.hms(0,0,0)). +DEBUG EVALUATE /xdate.month(date.mdy(6,30,1680) + time.hms(4,50,38)). +DEBUG EVALUATE /xdate.month(date.mdy(7,24,1716) + time.hms(12,31,35)). +DEBUG EVALUATE /xdate.month(date.mdy(6,19,1768) + time.hms(12,47,53)). +DEBUG EVALUATE /xdate.month(date.mdy(8,2,1819) + time.hms(1,26,0)). +DEBUG EVALUATE /xdate.month(date.mdy(3,27,1839) + time.hms(20,58,11)). +DEBUG EVALUATE /xdate.month(date.mdy(4,19,1903) + time.hms(7,36,5)). +DEBUG EVALUATE /xdate.month(date.mdy(8,25,1929) + time.hms(15,43,49)). +DEBUG EVALUATE /xdate.month(date.mdy(9,29,1941) + time.hms(4,25,9)). +DEBUG EVALUATE /xdate.month(date.mdy(4,19,1943) + time.hms(6,49,27)). +DEBUG EVALUATE /xdate.month(date.mdy(10,7,1943) + time.hms(2,57,52)). +DEBUG EVALUATE /xdate.month(date.mdy(3,17,1992) + time.hms(16,45,44)). +DEBUG EVALUATE /xdate.month(date.mdy(2,25,1996) + time.hms(21,30,57)). +DEBUG EVALUATE /xdate.month(date.mdy(9,29,1941) + time.hms(4,25,9)). +DEBUG EVALUATE /xdate.month(date.mdy(4,19,43) + time.hms(6,49,27)). +DEBUG EVALUATE /xdate.month(date.mdy(10,7,43) + time.hms(2,57,52)). +DEBUG EVALUATE /xdate.month(date.mdy(3,17,92) + time.hms(16,45,44)). +DEBUG EVALUATE /xdate.month(date.mdy(2,25,96) + time.hms(21,30,57)). +DEBUG EVALUATE /xdate.month(date.mdy(11,10,2038) + time.hms(22,30,4)). +DEBUG EVALUATE /xdate.month(date.mdy(7,18,2094) + time.hms(1,56,51)). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +]) +done +AT_CLEANUP + +AT_SETUP([expressions - XDATE.QUARTER]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +DEBUG EVALUATE /xdate.quarter(date.mdy(6,10,1648) + time.hms(0,0,0)). +DEBUG EVALUATE /xdate.quarter(date.mdy(6,30,1680) + time.hms(4,50,38)). +DEBUG EVALUATE /xdate.quarter(date.mdy(7,24,1716) + time.hms(12,31,35)). +DEBUG EVALUATE /xdate.quarter(date.mdy(6,19,1768) + time.hms(12,47,53)). +DEBUG EVALUATE /xdate.quarter(date.mdy(8,2,1819) + time.hms(1,26,0)). +DEBUG EVALUATE /xdate.quarter(date.mdy(3,27,1839) + time.hms(20,58,11)). +DEBUG EVALUATE /xdate.quarter(date.mdy(4,19,1903) + time.hms(7,36,5)). +DEBUG EVALUATE /xdate.quarter(date.mdy(8,25,1929) + time.hms(15,43,49)). +DEBUG EVALUATE /xdate.quarter(date.mdy(9,29,1941) + time.hms(4,25,9)). +DEBUG EVALUATE /xdate.quarter(date.mdy(4,19,1943) + time.hms(6,49,27)). +DEBUG EVALUATE /xdate.quarter(date.mdy(10,7,1943) + time.hms(2,57,52)). +DEBUG EVALUATE /xdate.quarter(date.mdy(3,17,1992) + time.hms(16,45,44)). +DEBUG EVALUATE /xdate.quarter(date.mdy(2,25,1996) + time.hms(21,30,57)). +DEBUG EVALUATE /xdate.quarter(date.mdy(9,29,1941) + time.hms(4,25,9)). +DEBUG EVALUATE /xdate.quarter(date.mdy(4,19,43) + time.hms(6,49,27)). +DEBUG EVALUATE /xdate.quarter(date.mdy(10,7,43) + time.hms(2,57,52)). +DEBUG EVALUATE /xdate.quarter(date.mdy(3,17,92) + time.hms(16,45,44)). +DEBUG EVALUATE /xdate.quarter(date.mdy(2,25,96) + time.hms(21,30,57)). +DEBUG EVALUATE /xdate.quarter(date.mdy(11,10,2038) + time.hms(22,30,4)). +DEBUG EVALUATE /xdate.quarter(date.mdy(7,18,2094) + time.hms(1,56,51)). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +]) +done +AT_CLEANUP + +AT_SETUP([expressions - XDATE.SECOND]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +DEBUG EVALUATE /xdate.second(date.mdy(6,10,1648) + time.hms(0,0,0)). +DEBUG EVALUATE /xdate.second(date.mdy(6,30,1680) + time.hms(4,50,38)). +DEBUG EVALUATE /xdate.second(date.mdy(7,24,1716) + time.hms(12,31,35)). +DEBUG EVALUATE /xdate.second(date.mdy(6,19,1768) + time.hms(12,47,53)). +DEBUG EVALUATE /xdate.second(date.mdy(8,2,1819) + time.hms(1,26,0)). +DEBUG EVALUATE /xdate.second(date.mdy(3,27,1839) + time.hms(20,58,11)). +DEBUG EVALUATE /xdate.second(date.mdy(4,19,1903) + time.hms(7,36,5)). +DEBUG EVALUATE /xdate.second(date.mdy(8,25,1929) + time.hms(15,43,49)). +DEBUG EVALUATE /xdate.second(date.mdy(9,29,1941) + time.hms(4,25,9)). +DEBUG EVALUATE /xdate.second(date.mdy(4,19,1943) + time.hms(6,49,27)). +DEBUG EVALUATE /xdate.second(date.mdy(10,7,1943) + time.hms(2,57,52)). +DEBUG EVALUATE /xdate.second(date.mdy(3,17,1992) + time.hms(16,45,44)). +DEBUG EVALUATE /xdate.second(date.mdy(2,25,1996) + time.hms(21,30,57)). +DEBUG EVALUATE /xdate.second(date.mdy(9,29,1941) + time.hms(4,25,9)). +DEBUG EVALUATE /xdate.second(date.mdy(4,19,43) + time.hms(6,49,27)). +DEBUG EVALUATE /xdate.second(date.mdy(10,7,43) + time.hms(2,57,52)). +DEBUG EVALUATE /xdate.second(date.mdy(3,17,92) + time.hms(16,45,44)). +DEBUG EVALUATE /xdate.second(date.mdy(2,25,96) + time.hms(21,30,57)). +DEBUG EVALUATE /xdate.second(date.mdy(11,10,2038) + time.hms(22,30,4)). +DEBUG EVALUATE /xdate.second(date.mdy(7,18,2094) + time.hms(1,56,51)). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +]) +done +AT_CLEANUP + +AT_SETUP([expressions - XDATE.TDAY]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +DEBUG EVALUATE /xdate.tday(date.mdy(6,10,1648) + time.hms(0,0,0)). +DEBUG EVALUATE /xdate.tday(date.mdy(6,30,1680) + time.hms(4,50,38)). +DEBUG EVALUATE /xdate.tday(date.mdy(7,24,1716) + time.hms(12,31,35)). +DEBUG EVALUATE /xdate.tday(date.mdy(6,19,1768) + time.hms(12,47,53)). +DEBUG EVALUATE /xdate.tday(date.mdy(8,2,1819) + time.hms(1,26,0)). +DEBUG EVALUATE /xdate.tday(date.mdy(3,27,1839) + time.hms(20,58,11)). +DEBUG EVALUATE /xdate.tday(date.mdy(4,19,1903) + time.hms(7,36,5)). +DEBUG EVALUATE /xdate.tday(date.mdy(8,25,1929) + time.hms(15,43,49)). +DEBUG EVALUATE /xdate.tday(date.mdy(9,29,1941) + time.hms(4,25,9)). +DEBUG EVALUATE /xdate.tday(date.mdy(4,19,1943) + time.hms(6,49,27)). +DEBUG EVALUATE /xdate.tday(date.mdy(10,7,1943) + time.hms(2,57,52)). +DEBUG EVALUATE /xdate.tday(date.mdy(3,17,1992) + time.hms(16,45,44)). +DEBUG EVALUATE /xdate.tday(date.mdy(2,25,1996) + time.hms(21,30,57)). +DEBUG EVALUATE /xdate.tday(date.mdy(9,29,1941) + time.hms(4,25,9)). +DEBUG EVALUATE /xdate.tday(date.mdy(4,19,43) + time.hms(6,49,27)). +DEBUG EVALUATE /xdate.tday(date.mdy(10,7,43) + time.hms(2,57,52)). +DEBUG EVALUATE /xdate.tday(date.mdy(3,17,92) + time.hms(16,45,44)). +DEBUG EVALUATE /xdate.tday(date.mdy(2,25,96) + time.hms(21,30,57)). +DEBUG EVALUATE /xdate.tday(date.mdy(11,10,2038) + time.hms(22,30,4)). +DEBUG EVALUATE /xdate.tday(date.mdy(7,18,2094) + time.hms(1,56,51)). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +]) +done +AT_CLEANUP + +AT_SETUP([expressions - XDATE.TIME]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +DEBUG EVALUATE /xdate.time(date.mdy(6,10,1648) + time.hms(0,0,0)). +DEBUG EVALUATE /xdate.time(date.mdy(6,30,1680) + time.hms(4,50,38)). +DEBUG EVALUATE /xdate.time(date.mdy(7,24,1716) + time.hms(12,31,35)). +DEBUG EVALUATE /xdate.time(date.mdy(6,19,1768) + time.hms(12,47,53)). +DEBUG EVALUATE /xdate.time(date.mdy(8,2,1819) + time.hms(1,26,0)). +DEBUG EVALUATE /xdate.time(date.mdy(3,27,1839) + time.hms(20,58,11)). +DEBUG EVALUATE /xdate.time(date.mdy(4,19,1903) + time.hms(7,36,5)). +DEBUG EVALUATE /xdate.time(date.mdy(8,25,1929) + time.hms(15,43,49)). +DEBUG EVALUATE /xdate.time(date.mdy(9,29,1941) + time.hms(4,25,9)). +DEBUG EVALUATE /xdate.time(date.mdy(4,19,1943) + time.hms(6,49,27)). +DEBUG EVALUATE /xdate.time(date.mdy(10,7,1943) + time.hms(2,57,52)). +DEBUG EVALUATE /xdate.time(date.mdy(3,17,1992) + time.hms(16,45,44)). +DEBUG EVALUATE /xdate.time(date.mdy(2,25,1996) + time.hms(21,30,57)). +DEBUG EVALUATE /xdate.time(date.mdy(9,29,1941) + time.hms(4,25,9)). +DEBUG EVALUATE /xdate.time(date.mdy(4,19,43) + time.hms(6,49,27)). +DEBUG EVALUATE /xdate.time(date.mdy(10,7,43) + time.hms(2,57,52)). +DEBUG EVALUATE /xdate.time(date.mdy(3,17,92) + time.hms(16,45,44)). +DEBUG EVALUATE /xdate.time(date.mdy(2,25,96) + time.hms(21,30,57)). +DEBUG EVALUATE /xdate.time(date.mdy(11,10,2038) + time.hms(22,30,4)). +DEBUG EVALUATE /xdate.time(date.mdy(7,18,2094) + time.hms(1,56,51)). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +]) +done +AT_CLEANUP + +AT_SETUP([expressions - XDATE.WEEK]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +DEBUG EVALUATE /xdate.week(date.mdy(6,10,1648) + time.hms(0,0,0)). +DEBUG EVALUATE /xdate.week(date.mdy(6,30,1680) + time.hms(4,50,38)). +DEBUG EVALUATE /xdate.week(date.mdy(7,24,1716) + time.hms(12,31,35)). +DEBUG EVALUATE /xdate.week(date.mdy(6,19,1768) + time.hms(12,47,53)). +DEBUG EVALUATE /xdate.week(date.mdy(8,2,1819) + time.hms(1,26,0)). +DEBUG EVALUATE /xdate.week(date.mdy(3,27,1839) + time.hms(20,58,11)). +DEBUG EVALUATE /xdate.week(date.mdy(4,19,1903) + time.hms(7,36,5)). +DEBUG EVALUATE /xdate.week(date.mdy(8,25,1929) + time.hms(15,43,49)). +DEBUG EVALUATE /xdate.week(date.mdy(9,29,1941) + time.hms(4,25,9)). +DEBUG EVALUATE /xdate.week(date.mdy(4,19,1943) + time.hms(6,49,27)). +DEBUG EVALUATE /xdate.week(date.mdy(10,7,1943) + time.hms(2,57,52)). +DEBUG EVALUATE /xdate.week(date.mdy(3,17,1992) + time.hms(16,45,44)). +DEBUG EVALUATE /xdate.week(date.mdy(2,25,1996) + time.hms(21,30,57)). +DEBUG EVALUATE /xdate.week(date.mdy(9,29,1941) + time.hms(4,25,9)). +DEBUG EVALUATE /xdate.week(date.mdy(4,19,43) + time.hms(6,49,27)). +DEBUG EVALUATE /xdate.week(date.mdy(10,7,43) + time.hms(2,57,52)). +DEBUG EVALUATE /xdate.week(date.mdy(3,17,92) + time.hms(16,45,44)). +DEBUG EVALUATE /xdate.week(date.mdy(2,25,96) + time.hms(21,30,57)). +DEBUG EVALUATE /xdate.week(date.mdy(11,10,2038) + time.hms(22,30,4)). +DEBUG EVALUATE /xdate.week(date.mdy(7,18,2094) + time.hms(1,56,51)). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +]) +done +AT_CLEANUP + +AT_SETUP([expressions - XDATE.WKDAY]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +DEBUG EVALUATE /xdate.wkday(date.mdy(6,10,1648)). +DEBUG EVALUATE /xdate.wkday(date.mdy(6,30,1680)). +DEBUG EVALUATE /xdate.wkday(date.mdy(7,24,1716)). +DEBUG EVALUATE /xdate.wkday(date.mdy(6,19,1768)). +DEBUG EVALUATE /xdate.wkday(date.mdy(8,2,1819)). +DEBUG EVALUATE /xdate.wkday(date.mdy(3,27,1839)). +DEBUG EVALUATE /xdate.wkday(date.mdy(4,19,1903)). +DEBUG EVALUATE /xdate.wkday(date.mdy(8,25,1929)). +DEBUG EVALUATE /xdate.wkday(date.mdy(9,29,1941)). +DEBUG EVALUATE /xdate.wkday(date.mdy(4,19,1943)). +DEBUG EVALUATE /xdate.wkday(date.mdy(10,7,1943)). +DEBUG EVALUATE /xdate.wkday(date.mdy(3,17,1992)). +DEBUG EVALUATE /xdate.wkday(date.mdy(2,25,1996)). +DEBUG EVALUATE /xdate.wkday(date.mdy(9,29,1941)). +DEBUG EVALUATE /xdate.wkday(date.mdy(4,19,43)). +DEBUG EVALUATE /xdate.wkday(date.mdy(10,7,43)). +DEBUG EVALUATE /xdate.wkday(date.mdy(3,17,92)). +DEBUG EVALUATE /xdate.wkday(date.mdy(2,25,96)). +DEBUG EVALUATE /xdate.wkday(date.mdy(11,10,2038)). +DEBUG EVALUATE /xdate.wkday(date.mdy(7,18,2094)). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +]) +done +AT_CLEANUP + +AT_SETUP([expressions - XDATE.YEAR]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +DEBUG EVALUATE /xdate.year(date.mdy(6,10,1648) + time.hms(0,0,0)). +DEBUG EVALUATE /xdate.year(date.mdy(6,30,1680) + time.hms(4,50,38)). +DEBUG EVALUATE /xdate.year(date.mdy(7,24,1716) + time.hms(12,31,35)). +DEBUG EVALUATE /xdate.year(date.mdy(6,19,1768) + time.hms(12,47,53)). +DEBUG EVALUATE /xdate.year(date.mdy(8,2,1819) + time.hms(1,26,0)). +DEBUG EVALUATE /xdate.year(date.mdy(3,27,1839) + time.hms(20,58,11)). +DEBUG EVALUATE /xdate.year(date.mdy(4,19,1903) + time.hms(7,36,5)). +DEBUG EVALUATE /xdate.year(date.mdy(8,25,1929) + time.hms(15,43,49)). +DEBUG EVALUATE /xdate.year(date.mdy(9,29,1941) + time.hms(4,25,9)). +DEBUG EVALUATE /xdate.year(date.mdy(4,19,1943) + time.hms(6,49,27)). +DEBUG EVALUATE /xdate.year(date.mdy(10,7,1943) + time.hms(2,57,52)). +DEBUG EVALUATE /xdate.year(date.mdy(3,17,1992) + time.hms(16,45,44)). +DEBUG EVALUATE /xdate.year(date.mdy(2,25,1996) + time.hms(21,30,57)). +DEBUG EVALUATE /xdate.year(date.mdy(9,29,1941) + time.hms(4,25,9)). +DEBUG EVALUATE /xdate.year(date.mdy(4,19,43) + time.hms(6,49,27)). +DEBUG EVALUATE /xdate.year(date.mdy(10,7,43) + time.hms(2,57,52)). +DEBUG EVALUATE /xdate.year(date.mdy(3,17,92) + time.hms(16,45,44)). +DEBUG EVALUATE /xdate.year(date.mdy(2,25,96) + time.hms(21,30,57)). +DEBUG EVALUATE /xdate.year(date.mdy(11,10,2038) + time.hms(22,30,4)). +DEBUG EVALUATE /xdate.year(date.mdy(7,18,2094) + time.hms(1,56,51)). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +]) +done +AT_CLEANUP + +AT_SETUP([expressions - DATEDIFF]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +DEBUG EVALUATE /datediff(date.mdy(6,10,1648), date.mdy(6,30,1680), 'years'). +DEBUG EVALUATE /datediff(date.mdy(6,30,1680), date.mdy(7,24,1716), 'years'). +DEBUG EVALUATE /datediff(date.mdy(7,24,1716), date.mdy(6,19,1768), 'years'). +DEBUG EVALUATE /datediff(date.mdy(6,19,1768), date.mdy(8,2,1819), 'years'). +DEBUG EVALUATE /datediff(date.mdy(8,2,1819), date.mdy(3,27,1839), 'years'). +DEBUG EVALUATE /datediff(date.mdy(3,27,1839), date.mdy(4,19,1903), 'years'). +DEBUG EVALUATE /datediff(date.mdy(4,19,1903), date.mdy(8,25,1929), 'years'). +DEBUG EVALUATE /datediff(date.mdy(8,25,1929), date.mdy(9,29,1941), 'years'). +DEBUG EVALUATE /datediff(date.mdy(9,29,1941), date.mdy(4,19,1943), 'years'). +DEBUG EVALUATE /datediff(date.mdy(4,19,1943), date.mdy(10,7,1943), 'years'). +DEBUG EVALUATE /datediff(date.mdy(10,7,1943), date.mdy(3,17,1992), 'years'). +DEBUG EVALUATE /datediff(date.mdy(3,17,1992), date.mdy(2,25,1996), 'years'). +DEBUG EVALUATE /datediff(date.mdy(9,29,1941), date.mdy(2,25,1996), 'years'). +DEBUG EVALUATE /datediff(date.mdy(9,29,1941), date.mdy(4,19,43), 'years'). +DEBUG EVALUATE /datediff(date.mdy(4,19,43), date.mdy(10,7,43), 'years'). +DEBUG EVALUATE /datediff(date.mdy(10,7,43), date.mdy(3,17,92), 'years'). +DEBUG EVALUATE /datediff(date.mdy(3,17,92), date.mdy(2,25,96), 'years'). +DEBUG EVALUATE /datediff(date.mdy(2,25,96), date.mdy(11,10,2038), 'years'). +DEBUG EVALUATE /datediff(date.mdy(11,10,2038), date.mdy(7,18,2094), 'years'). +DEBUG EVALUATE /datediff(date.mdy(2,29,1900), date.mdy(2,29,1904), 'years'). +DEBUG EVALUATE /datediff(date.mdy(2,29,1904), date.mdy(2,29,1908), 'years'). +DEBUG EVALUATE /datediff(date.mdy(2,29,1900), date.mdy(2,28,1903), 'years'). + +DEBUG EVALUATE /datediff(date.mdy(6,10,1648), date.mdy(6,30,1680), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(6,30,1680), date.mdy(7,24,1716), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(7,24,1716), date.mdy(6,19,1768), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(6,19,1768), date.mdy(8,2,1819), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(8,2,1819), date.mdy(3,27,1839), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(3,27,1839), date.mdy(4,19,1903), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(4,19,1903), date.mdy(8,25,1929), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(8,25,1929), date.mdy(9,29,1941), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(9,29,1941), date.mdy(4,19,1943), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(4,19,1943), date.mdy(10,7,1943), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(10,7,1943), date.mdy(3,17,1992), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(3,17,1992), date.mdy(2,25,1996), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(9,29,1941), date.mdy(2,25,1996), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(9,29,1941), date.mdy(4,19,43), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(4,19,43), date.mdy(10,7,43), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(10,7,43), date.mdy(3,17,92), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(3,17,92), date.mdy(2,25,96), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(2,25,96), date.mdy(11,10,2038), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(11,10,2038), date.mdy(7,18,2094), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(2,29,1900), date.mdy(2,29,1904), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(2,29,1904), date.mdy(2,29,1908), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(2,29,1900), date.mdy(2,28,1903), 'quarters'). + +DEBUG EVALUATE /datediff(date.mdy(6,10,1648), date.mdy(6,30,1680), 'months'). +DEBUG EVALUATE /datediff(date.mdy(6,30,1680), date.mdy(7,24,1716), 'months'). +DEBUG EVALUATE /datediff(date.mdy(7,24,1716), date.mdy(6,19,1768), 'months'). +DEBUG EVALUATE /datediff(date.mdy(6,19,1768), date.mdy(8,2,1819), 'months'). +DEBUG EVALUATE /datediff(date.mdy(8,2,1819), date.mdy(3,27,1839), 'months'). +DEBUG EVALUATE /datediff(date.mdy(3,27,1839), date.mdy(4,19,1903), 'months'). +DEBUG EVALUATE /datediff(date.mdy(4,19,1903), date.mdy(8,25,1929), 'months'). +DEBUG EVALUATE /datediff(date.mdy(8,25,1929), date.mdy(9,29,1941), 'months'). +DEBUG EVALUATE /datediff(date.mdy(9,29,1941), date.mdy(4,19,1943), 'months'). +DEBUG EVALUATE /datediff(date.mdy(4,19,1943), date.mdy(10,7,1943), 'months'). +DEBUG EVALUATE /datediff(date.mdy(10,7,1943), date.mdy(3,17,1992), 'months'). +DEBUG EVALUATE /datediff(date.mdy(3,17,1992), date.mdy(2,25,1996), 'months'). +DEBUG EVALUATE /datediff(date.mdy(9,29,1941), date.mdy(2,25,1996), 'months'). +DEBUG EVALUATE /datediff(date.mdy(9,29,1941), date.mdy(4,19,43), 'months'). +DEBUG EVALUATE /datediff(date.mdy(4,19,43), date.mdy(10,7,43), 'months'). +DEBUG EVALUATE /datediff(date.mdy(10,7,43), date.mdy(3,17,92), 'months'). +DEBUG EVALUATE /datediff(date.mdy(3,17,92), date.mdy(2,25,96), 'months'). +DEBUG EVALUATE /datediff(date.mdy(2,25,96), date.mdy(11,10,2038), 'months'). +DEBUG EVALUATE /datediff(date.mdy(11,10,2038), date.mdy(7,18,2094), 'months'). +DEBUG EVALUATE /datediff(date.mdy(2,29,1900), date.mdy(2,29,1904), 'months'). +DEBUG EVALUATE /datediff(date.mdy(2,29,1904), date.mdy(2,29,1908), 'months'). +DEBUG EVALUATE /datediff(date.mdy(2,29,1900), date.mdy(2,28,1903), 'months'). + +DEBUG EVALUATE /datediff(date.mdy(6,10,1648), date.mdy(6,30,1680), 'weeks'). +DEBUG EVALUATE /datediff(date.mdy(6,30,1680), date.mdy(7,24,1716), 'weeks'). +DEBUG EVALUATE /datediff(date.mdy(7,24,1716), date.mdy(6,19,1768), 'weeks'). +DEBUG EVALUATE /datediff(date.mdy(6,19,1768), date.mdy(8,2,1819), 'weeks'). +DEBUG EVALUATE /datediff(date.mdy(8,2,1819), date.mdy(3,27,1839), 'weeks'). +DEBUG EVALUATE /datediff(date.mdy(3,27,1839), date.mdy(4,19,1903), 'weeks'). +DEBUG EVALUATE /datediff(date.mdy(4,19,1903), date.mdy(8,25,1929), 'weeks'). +DEBUG EVALUATE /datediff(date.mdy(8,25,1929), date.mdy(9,29,1941), 'weeks'). +DEBUG EVALUATE /datediff(date.mdy(9,29,1941), date.mdy(4,19,1943), 'weeks'). +DEBUG EVALUATE /datediff(date.mdy(4,19,1943), date.mdy(10,7,1943), 'weeks'). +DEBUG EVALUATE /datediff(date.mdy(10,7,1943), date.mdy(3,17,1992), 'weeks'). +DEBUG EVALUATE /datediff(date.mdy(3,17,1992), date.mdy(2,25,1996), 'weeks'). +DEBUG EVALUATE /datediff(date.mdy(9,29,1941), date.mdy(2,25,1996), 'weeks'). +DEBUG EVALUATE /datediff(date.mdy(9,29,1941), date.mdy(4,19,43), 'weeks'). +DEBUG EVALUATE /datediff(date.mdy(4,19,43), date.mdy(10,7,43), 'weeks'). +DEBUG EVALUATE /datediff(date.mdy(10,7,43), date.mdy(3,17,92), 'weeks'). +DEBUG EVALUATE /datediff(date.mdy(3,17,92), date.mdy(2,25,96), 'weeks'). +DEBUG EVALUATE /datediff(date.mdy(2,25,96), date.mdy(11,10,2038), 'weeks'). +DEBUG EVALUATE /datediff(date.mdy(11,10,2038), date.mdy(7,18,2094), 'weeks'). +DEBUG EVALUATE /datediff(date.mdy(2,29,1900), date.mdy(2,29,1904), 'weeks'). +DEBUG EVALUATE /datediff(date.mdy(2,29,1904), date.mdy(2,29,1908), 'weeks'). +DEBUG EVALUATE /datediff(date.mdy(2,29,1900), date.mdy(2,28,1903), 'weeks'). + +DEBUG EVALUATE /datediff(date.mdy(6,10,1648), date.mdy(6,30,1680), 'days'). +DEBUG EVALUATE /datediff(date.mdy(6,30,1680), date.mdy(7,24,1716), 'days'). +DEBUG EVALUATE /datediff(date.mdy(7,24,1716), date.mdy(6,19,1768), 'days'). +DEBUG EVALUATE /datediff(date.mdy(6,19,1768), date.mdy(8,2,1819), 'days'). +DEBUG EVALUATE /datediff(date.mdy(8,2,1819), date.mdy(3,27,1839), 'days'). +DEBUG EVALUATE /datediff(date.mdy(3,27,1839), date.mdy(4,19,1903), 'days'). +DEBUG EVALUATE /datediff(date.mdy(4,19,1903), date.mdy(8,25,1929), 'days'). +DEBUG EVALUATE /datediff(date.mdy(8,25,1929), date.mdy(9,29,1941), 'days'). +DEBUG EVALUATE /datediff(date.mdy(9,29,1941), date.mdy(4,19,1943), 'days'). +DEBUG EVALUATE /datediff(date.mdy(4,19,1943), date.mdy(10,7,1943), 'days'). +DEBUG EVALUATE /datediff(date.mdy(10,7,1943), date.mdy(3,17,1992), 'days'). +DEBUG EVALUATE /datediff(date.mdy(3,17,1992), date.mdy(2,25,1996), 'days'). +DEBUG EVALUATE /datediff(date.mdy(9,29,1941), date.mdy(2,25,1996), 'days'). +DEBUG EVALUATE /datediff(date.mdy(9,29,1941), date.mdy(4,19,43), 'days'). +DEBUG EVALUATE /datediff(date.mdy(4,19,43), date.mdy(10,7,43), 'days'). +DEBUG EVALUATE /datediff(date.mdy(10,7,43), date.mdy(3,17,92), 'days'). +DEBUG EVALUATE /datediff(date.mdy(3,17,92), date.mdy(2,25,96), 'days'). +DEBUG EVALUATE /datediff(date.mdy(2,25,96), date.mdy(11,10,2038), 'days'). +DEBUG EVALUATE /datediff(date.mdy(11,10,2038), date.mdy(7,18,2094), 'days'). +DEBUG EVALUATE /datediff(date.mdy(2,29,1900), date.mdy(2,29,1904), 'days'). +DEBUG EVALUATE /datediff(date.mdy(2,29,1904), date.mdy(2,29,1908), 'days'). +DEBUG EVALUATE /datediff(date.mdy(2,29,1900), date.mdy(2,28,1903), 'days'). + +DEBUG EVALUATE /datediff(date.mdy(6,30,1680), date.mdy(6,10,1648), 'years'). +DEBUG EVALUATE /datediff(date.mdy(7,24,1716), date.mdy(6,30,1680), 'years'). +DEBUG EVALUATE /datediff(date.mdy(6,19,1768), date.mdy(7,24,1716), 'years'). +DEBUG EVALUATE /datediff(date.mdy(8,2,1819), date.mdy(6,19,1768), 'years'). +DEBUG EVALUATE /datediff(date.mdy(3,27,1839), date.mdy(8,2,1819), 'years'). +DEBUG EVALUATE /datediff(date.mdy(4,19,1903), date.mdy(3,27,1839), 'years'). +DEBUG EVALUATE /datediff(date.mdy(8,25,1929), date.mdy(4,19,1903), 'years'). +DEBUG EVALUATE /datediff(date.mdy(9,29,1941), date.mdy(8,25,1929), 'years'). +DEBUG EVALUATE /datediff(date.mdy(4,19,1943), date.mdy(9,29,1941), 'years'). +DEBUG EVALUATE /datediff(date.mdy(10,7,1943), date.mdy(4,19,1943), 'years'). +DEBUG EVALUATE /datediff(date.mdy(3,17,1992), date.mdy(10,7,1943), 'years'). +DEBUG EVALUATE /datediff(date.mdy(2,25,1996), date.mdy(3,17,1992), 'years'). +DEBUG EVALUATE /datediff(date.mdy(2,25,1996), date.mdy(9,29,1941), 'years'). +DEBUG EVALUATE /datediff(date.mdy(4,19,43), date.mdy(9,29,1941), 'years'). +DEBUG EVALUATE /datediff(date.mdy(10,7,43), date.mdy(4,19,43), 'years'). +DEBUG EVALUATE /datediff(date.mdy(3,17,92), date.mdy(10,7,43), 'years'). +DEBUG EVALUATE /datediff(date.mdy(2,25,96), date.mdy(3,17,92), 'years'). +DEBUG EVALUATE /datediff(date.mdy(11,10,2038), date.mdy(2,25,96), 'years'). +DEBUG EVALUATE /datediff(date.mdy(7,18,2094), date.mdy(11,10,2038), 'years'). +DEBUG EVALUATE /datediff(date.mdy(2,29,1904), date.mdy(2,29,1900), 'years'). +DEBUG EVALUATE /datediff(date.mdy(2,29,1908), date.mdy(2,29,1904), 'years'). +DEBUG EVALUATE /datediff(date.mdy(2,28,1903), date.mdy(2,29,1900), 'years'). + +DEBUG EVALUATE /datediff(date.mdy(6,30,1680), date.mdy(6,10,1648), 'months'). +DEBUG EVALUATE /datediff(date.mdy(7,24,1716), date.mdy(6,30,1680), 'months'). +DEBUG EVALUATE /datediff(date.mdy(6,19,1768), date.mdy(7,24,1716), 'months'). +DEBUG EVALUATE /datediff(date.mdy(8,2,1819), date.mdy(6,19,1768), 'months'). +DEBUG EVALUATE /datediff(date.mdy(3,27,1839), date.mdy(8,2,1819), 'months'). +DEBUG EVALUATE /datediff(date.mdy(4,19,1903), date.mdy(3,27,1839), 'months'). +DEBUG EVALUATE /datediff(date.mdy(8,25,1929), date.mdy(4,19,1903), 'months'). +DEBUG EVALUATE /datediff(date.mdy(9,29,1941), date.mdy(8,25,1929), 'months'). +DEBUG EVALUATE /datediff(date.mdy(4,19,1943), date.mdy(9,29,1941), 'months'). +DEBUG EVALUATE /datediff(date.mdy(10,7,1943), date.mdy(4,19,1943), 'months'). +DEBUG EVALUATE /datediff(date.mdy(3,17,1992), date.mdy(10,7,1943), 'months'). +DEBUG EVALUATE /datediff(date.mdy(2,25,1996), date.mdy(3,17,1992), 'months'). +DEBUG EVALUATE /datediff(date.mdy(2,25,1996), date.mdy(9,29,1941), 'months'). +DEBUG EVALUATE /datediff(date.mdy(4,19,43), date.mdy(9,29,1941), 'months'). +DEBUG EVALUATE /datediff(date.mdy(10,7,43), date.mdy(4,19,43), 'months'). +DEBUG EVALUATE /datediff(date.mdy(3,17,92), date.mdy(10,7,43), 'months'). +DEBUG EVALUATE /datediff(date.mdy(2,25,96), date.mdy(3,17,92), 'months'). +DEBUG EVALUATE /datediff(date.mdy(11,10,2038), date.mdy(2,25,96), 'months'). +DEBUG EVALUATE /datediff(date.mdy(7,18,2094), date.mdy(11,10,2038), 'months'). +DEBUG EVALUATE /datediff(date.mdy(2,29,1904), date.mdy(2,29,1900), 'months'). +DEBUG EVALUATE /datediff(date.mdy(2,29,1908), date.mdy(2,29,1904), 'months'). +DEBUG EVALUATE /datediff(date.mdy(2,28,1903), date.mdy(2,29,1900), 'months'). + +DEBUG EVALUATE /datediff(date.mdy(6,30,1680), date.mdy(6,10,1648), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(7,24,1716), date.mdy(6,30,1680), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(6,19,1768), date.mdy(7,24,1716), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(8,2,1819), date.mdy(6,19,1768), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(3,27,1839), date.mdy(8,2,1819), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(4,19,1903), date.mdy(3,27,1839), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(8,25,1929), date.mdy(4,19,1903), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(9,29,1941), date.mdy(8,25,1929), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(4,19,1943), date.mdy(9,29,1941), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(10,7,1943), date.mdy(4,19,1943), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(3,17,1992), date.mdy(10,7,1943), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(2,25,1996), date.mdy(3,17,1992), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(2,25,1996), date.mdy(9,29,1941), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(4,19,43), date.mdy(9,29,1941), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(10,7,43), date.mdy(4,19,43), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(3,17,92), date.mdy(10,7,43), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(2,25,96), date.mdy(3,17,92), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(11,10,2038), date.mdy(2,25,96), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(7,18,2094), date.mdy(11,10,2038), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(2,29,1904), date.mdy(2,29,1900), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(2,29,1908), date.mdy(2,29,1904), 'quarters'). +DEBUG EVALUATE /datediff(date.mdy(2,28,1903), date.mdy(2,29,1900), 'quarters'). + +dnl time of day is significant for DATEDIFF +DEBUG EVALUATE /datediff(date.mdy(10,15,1910) + 234, date.mdy(10,10,1910) + 123, 'days'). +DEBUG EVALUATE /datediff(date.mdy(10,15,1910) + 123, date.mdy(10,10,1910) + 234, 'days'). +DEBUG EVALUATE /datediff(date.mdy(10,24,1910) + 234, date.mdy(10,10,1910) + 123, 'weeks'). +DEBUG EVALUATE /datediff(date.mdy(10,24,1910) + 123, date.mdy(10,10,1910) + 234, 'weeks'). +DEBUG EVALUATE /datediff(date.mdy(10,10,1910) + 234, date.mdy(5,10,1910) + 123, 'months'). +DEBUG EVALUATE /datediff(date.mdy(10,10,1910) + 123, date.mdy(5,10,1910) + 234, 'months'). +DEBUG EVALUATE /datediff(date.mdy(5,10,1919) + 234, date.mdy(5,10,1910) + 123, 'years'). +DEBUG EVALUATE /datediff(date.mdy(5,10,1919) + 123, date.mdy(5,10,1910) + 234, 'years'). + +DEBUG EVALUATE /datediff(date.mdy(10,10,1910) + 123, date.mdy(10,15,1910) + 234, 'days'). +DEBUG EVALUATE /datediff(date.mdy(10,10,1910) + 234, date.mdy(10,15,1910) + 123, 'days'). +DEBUG EVALUATE /datediff(date.mdy(10,10,1910) + 123, date.mdy(10,24,1910) + 234, 'weeks'). +DEBUG EVALUATE /datediff(date.mdy(10,10,1910) + 234, date.mdy(10,24,1910) + 123, 'weeks'). +DEBUG EVALUATE /datediff(date.mdy(5,10,1910) + 123, date.mdy(10,10,1910) + 234, 'months'). +DEBUG EVALUATE /datediff(date.mdy(5,10,1910) + 234, date.mdy(10,10,1910) + 123, 'months'). +DEBUG EVALUATE /datediff(date.mdy(5,10,1910) + 123, date.mdy(5,10,1919) + 234, 'years'). +DEBUG EVALUATE /datediff(date.mdy(5,10,1910) + 234, date.mdy(5,10,1919) + 123, 'years'). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +]) +done +AT_CLEANUP + +AT_SETUP([expressions - DATESUM with non-leap year]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1900), 1, 'months') - date.mdy(1,1,1900)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1900), 2, 'months') - date.mdy(1,1,1900)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1900), 3, 'months') - date.mdy(1,1,1900)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1900), 4, 'months') - date.mdy(1,1,1900)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1900), 5.4, 'months') - date.mdy(1,1,1900)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1900), 6, 'months') - date.mdy(1,1,1900)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1900), 7, 'months') - date.mdy(1,1,1900)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1900), 8, 'months') - date.mdy(1,1,1900)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1900), 9, 'months') - date.mdy(1,1,1900)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1900), 10, 'months') - date.mdy(1,1,1900)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1900), 11, 'months') - date.mdy(1,1,1900)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1900), 12, 'months') - date.mdy(1,1,1900)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1900), 13.9, 'months') - date.mdy(1,1,1900)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1900), 1, 'months', 'rollover') - date.mdy(1,1,1900)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1900), 2, 'months', 'rollover') - date.mdy(1,1,1900)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1900), 3.2, 'months', 'rollover') - date.mdy(1,1,1900)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1900), 4, 'months', 'rollover') - date.mdy(1,1,1900)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1900), 5, 'months', 'rollover') - date.mdy(1,1,1900)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1900), 6, 'months', 'rollover') - date.mdy(1,1,1900)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1900), 7, 'months', 'rollover') - date.mdy(1,1,1900)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1900), 8, 'months', 'rollover') - date.mdy(1,1,1900)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1900), 9, 'months', 'rollover') - date.mdy(1,1,1900)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1900), 10, 'months', 'rollover') - date.mdy(1,1,1900)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1900), 11, 'months', 'rollover') - date.mdy(1,1,1900)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1900), 12, 'months', 'rollover') - date.mdy(1,1,1900)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1900), 13, 'months', 'rollover') - date.mdy(1,1,1900)). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +]) +done +AT_CLEANUP + +AT_SETUP([expressions - DATESUM with leap year]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1904), 1, 'months') - date.mdy(1,1,1904)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1904), 2.5, 'months') - date.mdy(1,1,1904)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1904), 3, 'months') - date.mdy(1,1,1904)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1904), 4.9, 'months') - date.mdy(1,1,1904)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1904), 5.1, 'months') - date.mdy(1,1,1904)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1904), 6, 'months') - date.mdy(1,1,1904)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1904), 7, 'months') - date.mdy(1,1,1904)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1904), 8, 'months') - date.mdy(1,1,1904)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1904), 9, 'months') - date.mdy(1,1,1904)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1904), 10, 'months') - date.mdy(1,1,1904)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1904), 11, 'months') - date.mdy(1,1,1904)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1904), 12, 'months') - date.mdy(1,1,1904)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1904), 13, 'months') - date.mdy(1,1,1904)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1904), 1, 'months', 'rollover') - date.mdy(1,1,1904)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1904), 2, 'months', 'rollover') - date.mdy(1,1,1904)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1904), 3, 'months', 'rollover') - date.mdy(1,1,1904)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1904), 4, 'months', 'rollover') - date.mdy(1,1,1904)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1904), 5, 'months', 'rollover') - date.mdy(1,1,1904)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1904), 6, 'months', 'rollover') - date.mdy(1,1,1904)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1904), 7, 'months', 'rollover') - date.mdy(1,1,1904)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1904), 8, 'months', 'rollover') - date.mdy(1,1,1904)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1904), 9, 'months', 'rollover') - date.mdy(1,1,1904)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1904), 10, 'months', 'rollover') - date.mdy(1,1,1904)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1904), 11, 'months', 'rollover') - date.mdy(1,1,1904)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1904), 12, 'months', 'rollover') - date.mdy(1,1,1904)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(1,31,1904), 13, 'months', 'rollover') - date.mdy(1,1,1904)). +]) +done +AT_CLEANUP + +AT_SETUP([expressions - DATESUM]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +DEBUG EVALUATE /ctime.days(datesum(date.mdy(6,10,1648), 1, 'weeks') - date.mdy(6,10,1648)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(6,30,1680), 2.5, 'weeks') - date.mdy(6,30,1680)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(7,24,1716), -3, 'weeks') - date.mdy(7,24,1716)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(6,19,1768), 4, 'weeks') - date.mdy(6,19,1768)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(8,2,1819), 5, 'weeks') - date.mdy(8,2,1819)). + +DEBUG EVALUATE /ctime.days(datesum(date.mdy(6,10,1648), 1, 'days') - date.mdy(6,10,1648)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(6,30,1680), 2.5, 'days') - date.mdy(6,30,1680)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(7,24,1716), -3, 'days') - date.mdy(7,24,1716)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(6,19,1768), 4, 'days') - date.mdy(6,19,1768)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(8,2,1819), 5, 'days') - date.mdy(8,2,1819)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(6,10,1648), 1, 'hours') - date.mdy(6,10,1648)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(6,30,1680), 2.5, 'hours') - date.mdy(6,30,1680)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(6,19,1768), -4, 'hours') - date.mdy(6,19,1768)). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(8,2,1819), 5, 'hours') - date.mdy(8,2,1819)). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +]) +done +AT_CLEANUP + +AT_SETUP([expressions - DATESUM preserves time of day for units of days and longer]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +DEBUG EVALUATE /ctime.days(datesum(date.mdy(8,2,1819) + time.hms(1,2,3), 5, 'days') - (date.mdy(8,2,1819) + time.hms(1,2,3))). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(8,2,1819) + time.hms(1,2,3), 5, 'weeks') - (date.mdy(8,2,1819) + time.hms(1,2,3))). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(8,2,1819) + time.hms(1,2,3), 5, 'months') - (date.mdy(8,2,1819) + time.hms(1,2,3))). +DEBUG EVALUATE /ctime.days(datesum(date.mdy(8,2,1819) + time.hms(1,2,3), 5, 'years') - (date.mdy(8,2,1819) + time.hms(1,2,3))). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +]) +done +AT_CLEANUP + +dnl These test values are from Applied Statistics, Algorithm AS 310. +AT_SETUP([expressions - NCDF.BETA]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +DEBUG EVALUATE /1000 * ncdf.beta(.868,10,20,150). +DEBUG EVALUATE /1000 * ncdf.beta(.9,10,10,120). +DEBUG EVALUATE /1000 * ncdf.beta(.88,15,5,80). +DEBUG EVALUATE /1000 * ncdf.beta(.85,20,10,110). +DEBUG EVALUATE /1000 * ncdf.beta(.66,20,30,65). +DEBUG EVALUATE /1000 * ncdf.beta(.72,20,50,130). +DEBUG EVALUATE /1000 * ncdf.beta(.72,30,20,80). +DEBUG EVALUATE /1000 * ncdf.beta(.8,30,40,130). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +]) +done +AT_CLEANUP + +dnl FIXME: LAG +dnl + [[X], [1.00], [], [(X = 1.00)]], + +dnl FIXME: out-of-range and nearly out-of-range values on dates +dnl +dnl Tests correctness of generic optimizations in optimize_tree(). +AT_SETUP([expressions - generic tree optimizations]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +DEBUG EVALUATE (x=10) /x + 0. +DEBUG EVALUATE (x=-3) /x - 0. +DEBUG EVALUATE (x=5) /0 + x. +DEBUG EVALUATE (x=10) /x * 1. +DEBUG EVALUATE (x=-3) /1 * x. +DEBUG EVALUATE (x=5) /x / 1. +DEBUG EVALUATE (x=10) /0 * x. +DEBUG EVALUATE (x=-3) /x * 0. +DEBUG EVALUATE (x=5) /0 / x. +DEBUG EVALUATE (x=5) /mod(0, x). +DEBUG EVALUATE (x=5) /x ** 1. +DEBUG EVALUATE (x=5) /x ** 2. +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +]) +done +AT_CLEANUP + +AT_SETUP([expressions - negative checks]) +AT_KEYWORDS([expression expressions evaluate]) +AT_DATA([evaluate-base.sps], [ +DEBUG EVALUATE SET opt. +DEBUG EVALUATE /$nonexistent. +DEBUG EVALUATE /RANGE(1, 2). +DEBUG EVALUATE /CONCAT.1('a', 'b'). +DEBUG EVALUATE /foobar(x). +DEBUG EVALUATE /CONCAT.1('a' b). +DEBUG EVALUATE /NCDF.CHISQ(1, 2, 3). +]) + +for opt in OPT NOOPT; do + AS_BOX([$opt]) + sed "s/opt/$opt/" < evaluate-base.sps > evaluate.sps + AT_CHECK([pspp --testing-mode evaluate.sps], [1], [dnl +]) +done +AT_CLEANUP + +AT_SETUP([expressions - LAG]) AT_DATA([lag.sps], [dnl data list /W 1. begin data. @@ -3176,7 +5129,7 @@ W,X,Y,Z ]) AT_CLEANUP -AT_SETUP([LAG crash bug]) +AT_SETUP([expression - LAG crash]) AT_DATA([lag.sps], [dnl DATA LIST LIST /x. BEGIN DATA @@ -3201,7 +5154,7 @@ hello AT_CLEANUP dnl Tests for a bug which caused UNIFORM(x) to always return zero. -AT_SETUP([UNIFORM function]) +AT_SETUP([expressions - UNIFORM]) AT_DATA([uniform.sps], [dnl set seed=10. input program. @@ -3243,7 +5196,7 @@ R1 ]) AT_CLEANUP -AT_SETUP([VALUELABEL function]) +AT_SETUP([expressions - VALUELABEL]) AT_DATA([valuelabel.sps], [dnl DATA LIST notable /n 1 s 2(a). VALUE LABELS /n 0 'Very dissatisfied' @@ -3287,7 +5240,7 @@ n,s,nlabel,slabel ]) AT_CLEANUP -AT_SETUP([variables in expressions]) +AT_SETUP([expressions - variables]) AT_DATA([variables.sps], [dnl DATA LIST NOTABLE/N1 TO N5 1-5. MISSING VALUES N1 TO N5 (3 THRU 5, 1). @@ -3336,7 +5289,7 @@ N1,N2,N3,N4,N5,P1,P2,P3,P4,P5,MC,VC,S1,S2,S3,S4,S5,M1,M2,M3,M4,M5,V1,V2,V3,V4,V5 ]) AT_CLEANUP -AT_SETUP([vectors in expressions]) +AT_SETUP([expressions - vectors]) AT_DATA([vectors.sps], [dnl DATA LIST NOTABLE /N1 TO N5 1-5. MISSING VALUES N1 TO N5 (3 THRU 5, 1). -- 2.30.2