| 106 | throw new Failure(label(a + " is not close to " + b + " (" + margin + ")", msg)); |
| 107 | } |
| 108 | function eqCharPos(a, b, msg) { |
| 109 | function str(p) { return "{line:" + p.line + ",ch:" + p.ch + ",sticky:" + p.sticky + "}"; } |
| 110 | if (a == b) return; |
| 111 | if (a == null) throw new Failure(label("comparing null to " + str(b), msg)); |
| 112 | if (b == null) throw new Failure(label("comparing " + str(a) + " to null", msg)); |
| 113 | if (a.line != b.line || a.ch != b.ch) throw new Failure(label(str(a) + " != " + str(b), msg)); |
| 114 | } |
| 115 | function eqCursorPos(a, b, msg) { |
| 116 | eqCharPos(a, b, msg); |
| 117 | if (a) eq(a.sticky, b.sticky, msg ? msg + ' (sticky)' : 'sticky'); |