(name, spec)
| 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", |
no test coverage detected