File modules/editor/codemirror/mode/xquery/test.min.js

Last commit: Tue May 22 22:39:49 2018 +0200	Jan Dankert	Fix für PHP 7.2: 'Object' darf nun nicht mehr als Klassennamen verwendet werden. AUCH NICHT IN EINEM NAMESPACE! WTF, wozu habe ich das in einen verfickten Namespace gepackt? Wozu soll der sonst da sein??? Amateure. Daher nun notgedrungen unbenannt in 'BaseObject'.
1 // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 // Distributed under an MIT license: http://codemirror.net/LICENSE 3 4 // Don't take these too seriously -- the expected results appear to be 5 // based on the results of actual runs without any serious manual 6 // verification. If a change you made causes them to fail, the test is 7 // as likely to wrong as the code. 8 9 (function() { 10 var mode = CodeMirror.getMode({tabSize: 4}, "xquery"); 11 function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } 12 13 MT("eviltest", 14 "[keyword xquery] [keyword version] [variable &quot;1][keyword .][atom 0][keyword -][variable ml&quot;][def&variable ;] [comment (: this is : a \"comment\" :)]", 15 " [keyword let] [variable $let] [keyword :=] [variable &lt;x] [variable attr][keyword =][variable &quot;value&quot;&gt;&quot;test&quot;&lt;func&gt][def&variable ;function]() [variable $var] {[keyword function]()} {[variable $var]}[variable &lt;][keyword /][variable func&gt;&lt;][keyword /][variable x&gt;]", 16 " [keyword let] [variable $joe][keyword :=][atom 1]", 17 " [keyword return] [keyword element] [variable element] {", 18 " [keyword attribute] [variable attribute] { [atom 1] },", 19 " [keyword element] [variable test] { [variable &#39;a&#39;] }, [keyword attribute] [variable foo] { [variable &quot;bar&quot;] },", 20 " [def&variable fn:doc]()[[ [variable foo][keyword /][variable @bar] [keyword eq] [variable $let] ]],", 21 " [keyword //][variable x] } [comment (: a more 'evil' test :)]", 22 " [comment (: Modified Blakeley example (: with nested comment :) ... :)]", 23 " [keyword declare] [variable private] [keyword function] [def&variable local:declare]() {()}[variable ;]", 24 " [keyword declare] [variable private] [keyword function] [def&variable local:private]() {()}[variable ;]", 25 " [keyword declare] [variable private] [keyword function] [def&variable local:function]() {()}[variable ;]", 26 " [keyword declare] [variable private] [keyword function] [def&variable local:local]() {()}[variable ;]", 27 " [keyword let] [variable $let] [keyword :=] [variable &lt;let&gt;let] [variable $let] [keyword :=] [variable &quot;let&quot;&lt;][keyword /let][variable &gt;]", 28 " [keyword return] [keyword element] [variable element] {", 29 " [keyword attribute] [variable attribute] { [keyword try] { [def&variable xdmp:version]() } [keyword catch]([variable $e]) { [def&variable xdmp:log]([variable $e]) } },", 30 " [keyword attribute] [variable fn:doc] { [variable &quot;bar&quot;] [keyword castable] [keyword as] [atom xs:string] },", 31 " [keyword element] [variable text] { [keyword text] { [variable &quot;text&quot;] } },", 32 " [def&variable fn:doc]()[[ [qualifier child::][variable eq][keyword /]([variable @bar] [keyword |] [qualifier attribute::][variable attribute]) [keyword eq] [variable $let] ]],", 33 " [keyword //][variable fn:doc]", 34 " }"); 35 36 MT("testEmptySequenceKeyword", 37 "[string \"foo\"] [keyword instance] [keyword of] [keyword empty-sequence]()"); 38 39 MT("testMultiAttr", 40 "[tag <p ][attribute a1]=[string \"foo\"] [attribute a2]=[string \"bar\"][tag >][variable hello] [variable world][tag </p>]"); 41 42 MT("test namespaced variable", 43 "[keyword declare] [keyword namespace] [variable e] [keyword =] [string \"http://example.com/ANamespace\"][variable ;declare] [keyword variable] [variable $e:exampleComThisVarIsNotRecognized] [keyword as] [keyword element]([keyword *]) [variable external;]"); 44 45 MT("test EQName variable", 46 "[keyword declare] [keyword variable] [variable $\"http://www.example.com/ns/my\":var] [keyword :=] [atom 12][variable ;]", 47 "[tag <out>]{[variable $\"http://www.example.com/ns/my\":var]}[tag </out>]"); 48 49 MT("test EQName function", 50 "[keyword declare] [keyword function] [def&variable \"http://www.example.com/ns/my\":fn] ([variable $a] [keyword as] [atom xs:integer]) [keyword as] [atom xs:integer] {", 51 " [variable $a] [keyword +] [atom 2]", 52 "}[variable ;]", 53 "[tag <out>]{[def&variable \"http://www.example.com/ns/my\":fn]([atom 12])}[tag </out>]"); 54 55 MT("test EQName function with single quotes", 56 "[keyword declare] [keyword function] [def&variable 'http://www.example.com/ns/my':fn] ([variable $a] [keyword as] [atom xs:integer]) [keyword as] [atom xs:integer] {", 57 " [variable $a] [keyword +] [atom 2]", 58 "}[variable ;]", 59 "[tag <out>]{[def&variable 'http://www.example.com/ns/my':fn]([atom 12])}[tag </out>]"); 60 61 MT("testProcessingInstructions", 62 "[def&variable data]([comment&meta <?target content?>]) [keyword instance] [keyword of] [atom xs:string]"); 63 64 MT("testQuoteEscapeDouble", 65 "[keyword let] [variable $rootfolder] [keyword :=] [string \"c:\\builds\\winnt\\HEAD\\qa\\scripts\\\"]", 66 "[keyword let] [variable $keysfolder] [keyword :=] [def&variable concat]([variable $rootfolder], [string \"keys\\\"])"); 67 })();
Download modules/editor/codemirror/mode/xquery/test.min.js
History Tue, 22 May 2018 22:39:49 +0200 Jan Dankert Fix für PHP 7.2: 'Object' darf nun nicht mehr als Klassennamen verwendet werden. AUCH NICHT IN EINEM NAMESPACE! WTF, wozu habe ich das in einen verfickten Namespace gepackt? Wozu soll der sonst da sein??? Amateure. Daher nun notgedrungen unbenannt in 'BaseObject'.