Thanks, this was helpful. It's on our list:
https://github.com/BaseXdb/basex/issues/903
On Fri, Mar 21, 2014 at 12:13 PM, Stefan Sechelmann sechel@math.tu-berlin.de wrote:
Hi Christian, thank you for looking into this. The test is run from an ant target that uses exec to run a standalone basex instance:
<target name="DGD Bibtex test suite" depends="DGD build backend"> <exec executable="basex/bin/basex" dir="${build-backend-path}" outputproperty="xqunit_bibtex_out" failonerror="true" logerror="true"> <arg value="${build-backend-path}/restxq-test/ajax/bibtex-parser-tests.xq"/> <arg value="${build-backend-path}/restxq-test/ajax/literature-tests.xq"/> </exec> <echo level="info" taskname="xqunit">${xqunit_bibtex_out}</echo> <condition property="xquery_unit_failure" value="true" else="false"> <or> <contains string="${xqunit_bibtex_out}" substring="failure line="/> <contains string="${xqunit_bibtex_out}" substring="error line="/> </or> </condition> <fail if="${xquery_unit_failure}" message="${xqunit_bibtex_out}"/> </target>
The file bibtex-parser-tests.xq is nothing special:
import module namespace bibparse = 'http://www... import module namespace data = 'http://www... declare namespace dgd = 'http://www.... declare namespace bibtex = 'http://... declare default element namespace 'http://...
declare %unit:test function local:test-inline-function() { let $f := function($x) {$x+1} return unit:assert-equals( $f(5), 6) };
... other tests ...
unit:test()
Best regards Stefan
Stefan Sechelmann DFG-Forschungszentrum Matheon Mathematik für Schlüsseltechnologien Technische Universität Berlin Sekretariat MA 8-3 Tel. 030/314 29 486 Straße des 17. Juni 136 Fax 030/314 79 282 10623 Berlin sechel@math.tu-berlin.de http://www.math.tu-berlin.de/~sechel
Am 21.03.2014 um 12:01 schrieb Christian Grün christian.gruen@gmail.com:
Thanks for trying. How do you run your test?
On Fri, Mar 21, 2014 at 11:55 AM, Stefan Sechelmann sechel@math.tu-berlin.de wrote:
I truied, it does not work: [copy] Copying 21 files to /Users/sechel/workspace/dgdgallery/build/backend/data DGD Bibtex test suite: [exec] Improper use? Potential bug? Your feedback is welcome: [exec] Contact: basex-talk@mailman.uni-konstanz.de [exec] Version: BaseX 8.0 beta e30d942 [exec] Java: Oracle Corporation, 1.8.0-ea [exec] OS: Mac OS X, x86_64 [exec] Stack Trace: [exec] java.lang.ClassCastException: org.basex.query.value.type.AtomType cannot be cast to org.basex.query.value.type.FuncType [exec] at org.basex.query.func.Closure.item(Closure.java:275) [exec] at org.basex.query.func.Closure.value(Closure.java:295) [exec] at org.basex.query.QueryContext.value(QueryContext.java:407) [exec] at org.basex.query.gflwor.Let$LetEval.next(Let.java:229) [exec] at org.basex.query.gflwor.GFLWOR$2.next(GFLWOR.java:74)
Stefan Sechelmann DFG-Forschungszentrum Matheon Mathematik für Schlüsseltechnologien Technische Universität Berlin Sekretariat MA 8-3 Tel. 030/314 29 486 Straße des 17. Juni 136 Fax 030/314 79 282 10623 Berlin sechel@math.tu-berlin.de http://www.math.tu-berlin.de/~sechel
Am 20.03.2014 um 18:35 schrieb Jan Techter techter@mailbox.tu-berlin.de:
declare %unit:test function local:test-inline-function() { let $f := function($x) {$x+1} return unit:assert-equals( $f(5), 6) };
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk