MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / test

Function test

lib/web/CodeMirror/test/sql-hint-test.js:53–70  ·  view source on GitHub ↗
(name, spec)

Source from the content-addressed store, hash-verified

51 namespace = "sql-hint_";
52
53 function test(name, spec) {
54 testCM(name, function(cm) {
55 cm.setValue(spec.value);
56 cm.setCursor(spec.cursor);
57 var completion = CodeMirror.hint.sql(cm, {
58 tables: spec.tables,
59 defaultTable: spec.defaultTable,
60 disableKeywords: spec.disableKeywords
61 });
62 if (!deepCompare(completion.list, spec.list))
63 throw new Failure("Wrong completion results " + JSON.stringify(completion.list) + " vs " + JSON.stringify(spec.list));
64 eqCharPos(completion.from, spec.from);
65 eqCharPos(completion.to, spec.to);
66 }, {
67 value: spec.value,
68 mode: spec.mode || "text/x-mysql"
69 });
70 }
71
72 test("keywords", {
73 value: "SEL",

Callers 1

sql-hint-test.jsFile · 0.70

Calls 4

testCMFunction · 0.85
eqCharPosFunction · 0.85
deepCompareFunction · 0.70
setValueMethod · 0.45

Tested by

no test coverage detected