summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* * tests/011/macros-1.txr: Add test for lexical functionKaz Kylheku2015-02-072-0/+7
| | | | | | shadowing symbol macro. * tests/011/macros-1.expected: Updated.
* * share/txr/stdlib/txr-case.txr: New file.Kaz Kylheku2014-10-212-0/+13
| | | | | | | | | | | | * txr.1: Document txr-if, txr-when and txr-case. * genvim.txr: Added new macro names. * tests/011/txr-case.expected: New file. * tests/011/txr-case.txr: New file. * txr.vim: Regenerated.
* Add test case for recent breakage.Kaz Kylheku2014-10-083-0/+324
| | | | | | | | | | * tests/006/freeform-3.expected: New file. * tests/006/freeform-3.txr: New file. * tests/006/passwd: New file. * Makefile (TXR_ARGS): Set up for new test case.
* * tests/001/query-1.txr: Remove bogus public domain header.Kaz Kylheku2014-07-155-20/+0
| | | | | | | | | | * tests/001/query-2.txr: Likewise. * tests/001/query-3.txr: Likewise. * tests/001/query-4.txr: Likewise. * tests/002/query-1.txr: Likewise.
* * tests/011/macros-2.txr: Added test for labels shadowing macro,Kaz Kylheku2014-07-102-2/+14
| | | | | | | | and let shadowing symacro. * tests/011/macros-2.expected: Regenerated * txr.vim: Regenerated.
* * parser.l: Allowing ^ to be a quote character, and adjusting definitionKaz Kylheku2014-03-035-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of identifiers to rule this out from being the first character of a symbol which has no prefix. Recognize the ^ character as a token in the NESTED state. * lib.c (obj_print, obj_pprint): Render sys:qquote as ^. * parser.y (choose_quote): Function removed. (n_expr): Recognize '^' as quasiquote. Removed all the "smart quote" hacks that try to make quote behave as quote or quasiquote, or try to cancel out unquotes and quotes. * tests/009/json.txr: Fixed to ^ quasiquote. * tests/010/reghash.txr: Likewise. * tests/011/macros-2.txr: Likewise. * tests/011/mandel.txr: Likewise. * tests/011/special-1.txr: Likewise. * txr.1: Updated docs. * genvim.txr: Revamped definitions for txr_ident and txl_ident so that unqualified identifiers cannot start with # or ^, but ones with @ or : in front can start with these characters. * txr.vim: Regenerated.
* * tests/011/special-1.txr: Add some coverage for evaluationKaz Kylheku2014-03-011-1/+2
| | | | | | of a re-bound special under the Lisp-1 evaluation of the [ ] notation. This test case would have failed three commits back.
* * tests/011/mandel.expected: New file.Kaz Kylheku2014-02-282-0/+123
| | | | * tests/011/mandel.txr: New file.
* Change in the design of how special variables work, to fix the brokenKaz Kylheku2014-02-282-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | re-binding. C code now has to go through the dynamic environment lookup to access things like *random-state*, or *stdout*. As part of this, I'm moving some intrinsic variable and function initializations out of eval.c and into their respective modules. Macros are are used to make global variables look like ordinary C variables. This is very similar to the errno trick in POSIX threads implementations. * eval.c (looup_var, lookup_var_l): Restructured to eliminate silly goto, the cobjp handling is gone. (reg_fun, reg_var): Internal function becomes external. reg_var registers a simple cons cell binding now, without any C pointer tricks to real C global variables. (c_var_mark): Static function removed. (c_var_ops): Static struct removed. (eval_init): Numerous initializations for streams, syslog, rand, signals and others moved to their respective modules. The new symbol variables user_package_s, keyword_package_s and system_package_s are interned here, and the variables are created in a special way. * eval.h (reg_var, reg_fun): Declared. * gc.c (prot1): Added assert that the loc pointer isn't null. This happened, and blew up during garbage collection. * lib.c (system_package, keyword_package, user_package): Variables removed these become macros. (system_package_var, keyword_package_var, user_package_var): New global variables. (system_package_s, keyword_package_s, user_package_s): New symbol globals. (get_user_package, get_system_package, get_keyword_package): New functions. (obj_init): Protect new variables. Initialization order of modules tweaked: the modules sig_init, stream_init, and rand_init are moved after eval_init because they register variables. * lib.h (keyword_package, system_pckage, user_package): Variables turned into macros. (system_package_var, keyword_package_var, user_package_var): Declared. (system_package_s, keyword_package_s, user_package_s): Declared. (get_user_package, get_system_package, get_keyword_package): Declared. * rand.c (struct random_state): Renamed to struct rand_state to avoid clash with new random_state macro. (random_state): Global variable removed. (random_state_s): New symbol global. (make_state, rand32, make_random_state, random_fixnum, random): Follow rename of struct random_state.
* * tests/010/output-clauses.expected: New file.Kaz Kylheku2014-02-282-0/+78
| | | | * tests/010/output-clauses.txr: New file.
* About time for some new regression tests.Kaz Kylheku2014-02-286-0/+74
| | | | | | | | | | | | | | * tests/011/macros-1.expected: New file. * tests/011/macros-1.txr: New file. * tests/011/macros-2.expected: New file. * tests/011/macros-2.txr: New file. * tests/011/special-1.expected: New file. * tests/011/special-1.txr: New file.
* * stream.c (vformat): Compensate for differences in printfKaz Kylheku2012-03-271-1/+1
| | | | | | | implementations with regard to printing floating point exponents. by deleting any plus sign and leading zeros after the 'e'. * tests/009/json.expected: Regenerated.
* * Makefile (TXR_ARGS): Pass new file to tests/009/json.txr test.Kaz Kylheku2012-03-233-17/+117
| | | | | | | | | | * tests/009/json.expected: Updated. * tests/009/json.txr: Updated source. Translates to a more native representation with vectors and hash tables. Numbers go to floating point instead of remaining as strings. * tests/009/pass1.json: New file: a test case from json.org.
* * tests/010/block.expected: New file.Kaz Kylheku2012-03-154-0/+14
| | | | | | | | * tests/010/block.txr: New file. * tests/010/reghash.expected: New file. * tests/010/reghash.txr: New file.
* * stream.c (string_out_byte_flush): Bugfix. Do not loop inside thisKaz Kylheku2012-03-132-0/+12
| | | | | | | | | | | | | | | | | | | | | | function. This must not flush out more than one character out of this small buffer, except when we are flushing out the last data. The correct operation is predicated on the assumption that a complete character can be pulled out. That's why we move the buffer to the front after consuming it, and do not automatically flush until there are four bytes. (string_out_put_string): We loop the call to string_out_byte_flush here because when a request comes in to write a Unicode character, we flush all the bytes, even if the tail of those bytes forms an incomplete sequence that turns into U+DCxx codes. (get_string_from_stream): Use the same loop termination test as in string_out_put_string, for consistency. In that function it is needed to prevent infinite looping in the case when the string_out_put_string is being called from string_out_byte_flush and is thus re-entering it. * tests/010/strstream.expected: New file. * tests/010/strstream.txr: New file.
* Fixing long-time (pre-GIT) bug. The object (nil) was stupidly used toKaz Kylheku2012-02-262-0/+24
| | | | | | | | | | | | | | | | | | | | | represent empty optional output clauses, distinguishing them from missing clauses. This creates an ambiguity, so that an @(output) block which puts out a single empty line is treated as empty. Present but empty clauses are now represented by t. * match.c (do_output_line): Check for t and bail. (do_output): Check for t instead of (nil) and bail. * parser.y (o_elems_opt2): Nonterminal deleted. (out_clauses_opt): Empty case generates nil. (req_parts_opt): o_elems_opt2 replaced by o_elems_opt. (repeat_rep_helper): Function now keeps track of which clauses were specified. For those that were specified, but empty, it substitutes t. * tests/008/empty-clauses.expected: New file. * tests/008/empty-clauses.txr: New file.
* * tests/008/filtenv.expected: New file.Kaz Kylheku2012-02-252-0/+7
| | | | * tests/008/filtenv.txr: New file.
* * tests/010/seq.txr: New file.Kaz Kylheku2012-02-222-0/+33
| | | | * tests/010/seq.expected: New file.
* This test case would have caught the prior regression.Kaz Kylheku2012-02-023-0/+54
| | | | | | | | | | * Makefile (TXR_ARGS): Defined for new test case. * tests/010/align-columns.dat: New file. * tests/010/align-columns.expected: New file. * tests/010/align-columns.txr: New file.
* Test case for bug #35137Kaz Kylheku2011-12-202-0/+22
| | | | | | * tests/007/except-2.expected: New file. * tests/007/except-2.txr: New file.
* * lib.c (getplist_f): New function.Kaz Kylheku2011-11-241-1/+1
| | | | | | | | | | | | | * lib.h (getplist_f): Declared. * match.c (v_collect, h_coll): Use getplist_f to distinguish the case that :vars is explicitly specified as (). In this case, no bindings escape from the collect. * tests/008/soundex.txr: This test case broke due to using :vars () and yet counting on the variable to exist. * RELNOTES: Updated.
* * Makefile (tests/008/soundex.ok): New test case.Kaz Kylheku2011-11-192-0/+85
| | | | | | | | (TXR_ARGS): Specified for new test case. * tests/008/soundex.expected: New file. * tests/008/soundex.txr: New file.
* Added a JSON parsing test case. This flushed out a bug which crashedKaz Kylheku2011-11-183-0/+147
| | | | | | | | | | | | | | | | | | the garbage collector (uninitialized fields in function objects). * Makefile: Defined TXR_ARGS and TXR_OPTS for new test case. * hash.c (hash_begin): Construction of cobj modified to obey the correct procedure described in HACKING. * lib.c (func_n3, func_n4): These functions neglected to initialize the env member of the function structure. * tests/009/json.expected: New file. * tests/009/json.txr: New file. * tests/009/webapp.json: New file.
* * tests/008/students.txr: Use disciplined collect with :vars.Kaz Kylheku2011-11-031-4/+1
|
* * tests/008/students.txr: Regexes removed.Kaz Kylheku2011-11-031-2/+2
|
* * match.c (v_cat): Bugfix: unterminated variable argument list.Kaz Kylheku2011-10-261-1/+1
| | | | * tests/001/query-3.txr: Updated to new cat syntax.
* * tests/007/except-1.txr: Use next :list insteadKaz Kylheku2011-10-231-1/+1
| | | | | of piping from echo command. As a result, this test case should run on MingW.
* * Makefile (%.ok: %.txr): Use unified diff for showingKaz Kylheku2011-10-133-1/+704
| | | | | | | | | | | | | | | | | | | | | | | | | | differences between expected and actual test output. * parser.l (yybadtoken): Handle new terminal symbol, SPACE. New rule for producing SPACE token out of an extent of tabs and spaces. * parser.y (SPACE): New terminal symbol. (o_var): New nonterminal. I noticed that the var rule was being used for output elements, and the var rule refers to elem rather than o_elem. A new o_var rule is a simplified duplicate of var. (elem): Handle SPACE token. Transform to regex if it is a single space, otherwise to literal text. (o_elem): Handle SPACE token in output. * tests/001/query-2.txr: This query depends on matching single spaces and so needs to use escapes. * tests/001/query-4.txr, test/001/query-4.expected: New test case, based on query-2.txr. It produces the same output, but is simpler thanks to the new semantics of space. * txr.1: Documented.
* Added missing data.Kaz Kylheku2011-10-011-0/+6
|
* New test case, covering some filtering from HTML/XML.Kaz Kylheku2011-10-013-0/+31
| | | | | | | | * Makefile: Defined TXR_ARGS for new test case. * tests/008/students.expected: New file. * tests/008/students.txr: New file. * tests/008/students.xml: New file.
* New test case under tests/008.Kaz Kylheku2011-10-013-0/+56
| | | | | | | | | | | | * Makefile: Made previous TXR_ARGS for 008 specific to tokenizing test case, and introduced separate TXR_ARGS for this test case. * tests/008/configfile: New file. * tests/008/configfile.expected: New file. * tests/008/configfile.txr: New file.
* Remove accidentally added .out file.Kaz Kylheku2011-10-011-2/+0
|
* Tokenizing test case, exercising for @(coll :gap 0)Kaz Kylheku2011-10-013-0/+28
| | | | | | | | | | and horizontal @(choose :shortest ...). * Makefile: Defined TXR_ARGS for tests/008 directory. * tests/008/data: New file. * tests/008/tokenize.expected: New file. * tests/008/tokenize.txr: New file.
* New test case, covering exception handling across nestedKaz Kylheku2011-10-013-0/+36
| | | | | | | | | | function invocations. * Makefile (TEST): Test targets marked as .PHONY, because they are. * tests/007/except-1.expected: New file. * tests/007/except-1.out: New file. * tests/007/except-1.txr: New file.
* * tests/002/query-1.txr: Old next syntax rewritten to new.Kaz Kylheku2011-09-231-3/+3
|
* More testcases.Kaz Kylheku2010-02-282-0/+10
|
* New testcase for freeform.Kaz Kylheku2010-02-283-0/+31
|
* Switching to keyword symbols for :args and :nothrow.Kaz Kylheku2009-11-241-1/+1
|
* New testcase which does some UTF-8 scanning, Unicode regexes,Kaz Kylheku2009-11-133-0/+34
| | | | and @(freeform).
* Bug ID 27898: Directory order dependencies in test case.Kaz Kylheku2009-11-01197-108/+111
| | | | Converted some directories to text files.
* Starting txr git.graftedtxr-018Kaz Kylheku2009-10-302-0/+70
|
* txr-012 2009-09-28txr-012Kaz Kylheku2017-07-312-0/+20
|
* txr-011 2009-09-25txr-011Kaz Kylheku2017-07-31202-0/+4340