text: // Generated by ReScript, PLEASE EDIT WITH CARE
  'use strict';
  
  var Curry = require("bs-platform/lib/js/curry.js");
  var Js_exn = require("bs-platform/lib/js/js_exn.js");
  var Vscode = require("vscode");
  var $$Promise = require("reason-promise/lib/js/src/js/promise.bs.js");
  var Belt_Array = require("bs-platform/lib/js/belt_Array.js");
  var Belt_Option = require("bs-platform/lib/js/belt_Option.js");
  var Caml_option = require("bs-platform/lib/js/caml_option.js");
  var Mocha$BsMocha = require("bs-mocha/lib/js/src/Mocha.bs.js");
  var IM$AgdaModeVscode = require("../../src/InputMethod/IM.bs.js");
  var Chan$AgdaModeVscode = require("../../src/Util/Chan.bs.js");
  var Main$AgdaModeVscode = require("../../src/Main.bs.js");
  var Util$AgdaModeVscode = require("../../src/Util/Util.bs.js");
  var Editor$AgdaModeVscode = require("../../src/Editor.bs.js");
  var Test__Util$AgdaModeVscode = require("./Test__Util.bs.js");
  
  function activateExtension(fileName) {
    var disposables = [];
    var extensionPath = Test__Util$AgdaModeVscode.Path.extensionPath(undefined);
    var chan = Main$AgdaModeVscode.activateWithoutContext(disposables, extensionPath, false);
    return $$Promise.map(Vscode.window.showTextDocument(Vscode.Uri.file(fileName), undefined), (function (editor) {
                  return {
                          editor: editor,
                          chan: chan
                        };
                }));
  }
  
  function acquire(setup) {
    var setup$1 = setup.contents;
    if (setup$1 !== undefined) {
      return $$Promise.resolved({
                  TAG: 0,
                  _0: Caml_option.valFromOption(setup$1),
                  [Symbol.for("name")]: "Ok"
                });
    } else {
      return $$Promise.resolved({
                  TAG: 1,
                  _0: {
                    RE_EXN_ID: Util$AgdaModeVscode.$$Error,
                    _1: "Cannot acquire the setup"
                  },
                  [Symbol.for("name")]: "Error"
                });
    }
  }
  
  function cleanup(setup) {
    var range = new Vscode.Range(new Vscode.Position(0, 0), new Vscode.Position(100, 0));
    return Editor$AgdaModeVscode.$$Text.replace(setup.editor.document, range, "");
  }
  
  function equal(xs) {
    return function (param) {
      return Test__Util$AgdaModeVscode.A.equal(xs, param);
    };
  }
  
  function deep_equal(xs) {
    return function (param) {
      return Test__Util$AgdaModeVscode.A.deep_equal(xs, param);
    };
  }
  
  function wait(setup) {
    return $$Promise.map(Chan$AgdaModeVscode.once(setup.chan), (function (x) {
                  return {
                          TAG: 0,
                          _0: x,
                          [Symbol.for("name")]: "Ok"
                        };
                }));
  }
  
  function wait2nd(setup) {
    return $$Promise.map($$Promise.flatMap(Chan$AgdaModeVscode.once(setup.chan), (function (param) {
                      return Chan$AgdaModeVscode.once(setup.chan);
                    })), (function (x) {
                  return {
                          TAG: 0,
                          _0: x,
                          [Symbol.for("name")]: "Ok"
                        };
                }));
  }
  
  function activate(setup, positions, param) {
    var promise = wait(setup);
    var positions$1 = Belt_Option.getWithDefault(positions, Editor$AgdaModeVscode.Cursor.getMany(setup.editor));
    Editor$AgdaModeVscode.Cursor.setMany(setup.editor, positions$1);
    return $$Promise.flatMap($$Promise.flatMap(Vscode.commands.executeCommand("agda-mode.input-symbol[Activate]"), (function (result) {
                      return result;
                    })), (function (param) {
                  return promise;
                }));
  }
  
  function deactivate(setup) {
    var promise = wait(setup);
    return $$Promise.flatMap($$Promise.flatMap(Vscode.commands.executeCommand("agda-mode.escape"), (function (result) {
                      return result;
                    })), (function (param) {
                  return promise;
                }));
  }
  
  function insertChar(setup, $$char) {
    var promise1 = wait(setup);
    var promise2 = wait2nd(setup);
    var positions = Editor$AgdaModeVscode.Cursor.getMany(setup.editor);
    return $$Promise.flatMapOk($$Promise.flatMapOk($$Promise.map(Editor$AgdaModeVscode.$$Text.batchInsert(setup.editor.document, positions, $$char), (function (succeed) {
                          if (succeed) {
                            return {
                                    TAG: 0,
                                    _0: undefined,
                                    [Symbol.for("name")]: "Ok"
                                  };
                          } else {
                            return {
                                    TAG: 1,
                                    _0: Js_exn.raiseError("Failed to insert " + $$char),
                                    [Symbol.for("name")]: "Error"
                                  };
                          }
                        })), (function (param) {
                      return promise1;
                    })), (function (result1) {
                  return $$Promise.mapOk(promise2, (function (result2) {
                                return Belt_Array.concat(result1, result2);
                              }));
                }));
  }
  
  function backspace(setup) {
    var promise1 = wait(setup);
    var promise2 = wait2nd(setup);
    var end_ = Editor$AgdaModeVscode.Cursor.get(setup.editor);
    var start = end_.translate(0, -1);
    var range = new Vscode.Range(start, end_);
    return $$Promise.flatMapOk($$Promise.flatMapOk($$Promise.map(Editor$AgdaModeVscode.$$Text.$$delete(setup.editor.document, range), (function (succeed) {
                          if (succeed) {
                            return {
                                    TAG: 0,
                                    _0: undefined,
                                    [Symbol.for("name")]: "Ok"
                                  };
                          } else {
                            return {
                                    TAG: 1,
                                    _0: Js_exn.raiseError("Failed to backspace"),
                                    [Symbol.for("name")]: "Error"
                                  };
                          }
                        })), (function (param) {
                      return promise1;
                    })), (function (result1) {
                  return $$Promise.mapOk(promise2, (function (result2) {
                                return Belt_Array.concat(result1, result2);
                              }));
                }));
  }
  
  function select(setup, intervals) {
    var partial_arg = setup.editor.document;
    var ranges = Belt_Array.map(intervals, (function (param) {
            return Editor$AgdaModeVscode.$$Range.fromInterval(partial_arg, param);
          }));
    Editor$AgdaModeVscode.$$Selection.setMany(setup.editor, ranges);
    return $$Promise.resolved({
                TAG: 0,
                _0: undefined,
                [Symbol.for("name")]: "Ok"
              });
  }
  
  function selectAndWait(setup, intervals) {
    var promise = wait(setup);
    var partial_arg = setup.editor.document;
    var ranges = Belt_Array.map(intervals, (function (param) {
            return Editor$AgdaModeVscode.$$Range.fromInterval(partial_arg, param);
          }));
    Editor$AgdaModeVscode.$$Selection.setMany(setup.editor, ranges);
    return promise;
  }
  
  var IM = {
    Input: IM$AgdaModeVscode.Input,
    Output: IM$AgdaModeVscode.Output,
    Log: IM$AgdaModeVscode.Log,
    Module: IM$AgdaModeVscode.Module,
    make: IM$AgdaModeVscode.make,
    isActivated: IM$AgdaModeVscode.isActivated,
    run: IM$AgdaModeVscode.run,
    equal: equal,
    deep_equal: deep_equal,
    wait: wait,
    wait2nd: wait2nd,
    activate: activate,
    deactivate: deactivate,
    insertChar: insertChar,
    backspace: backspace,
    select: select,
    selectAndWait: selectAndWait
  };
  
  Mocha$BsMocha.describe("Input Method (Editor)")(undefined, undefined, undefined, (function (param) {
          var setup = {
            contents: undefined
          };
          Test__Util$AgdaModeVscode.Q.before(function (param) {
                return $$Promise.map(activateExtension(Test__Util$AgdaModeVscode.Path.asset("InputMethod.agda")), (function (value) {
                              setup.contents = value;
                              return {
                                      TAG: 0,
                                      _0: undefined,
                                      [Symbol.for("name")]: "Ok"
                                    };
                            }));
              });
          Test__Util$AgdaModeVscode.Q.after_each(function (param) {
                return $$Promise.mapOk(acquire(setup), cleanup);
              });
          Mocha$BsMocha.describe("Insertion")(undefined, undefined, undefined, (function (param) {
                  Test__Util$AgdaModeVscode.Q.it("should translate \"lambdabar\" to \"λ\"", (function (param) {
                          return $$Promise.flatMapOk(acquire(setup), (function (setup) {
                                        var $$document = setup.editor.document;
                                        var partial_arg = [/* Activate */2];
                                        var partial_arg$1 = [
                                          {
                                            _0: [[
                                                [
                                                  0,
                                                  1
                                                ],
                                                "←"
                                              ]],
                                            [Symbol.for("name")]: "RewriteIssued"
                                          },
                                          /* UpdateView */0,
                                          /* RewriteApplied */1
                                        ];
                                        var partial_arg$2 = [
                                          {
                                            _0: [],
                                            [Symbol.for("name")]: "RewriteIssued"
                                          },
                                          /* UpdateView */0,
                                          /* RewriteApplied */1
                                        ];
                                        var partial_arg$3 = [
                                          {
                                            _0: [],
                                            [Symbol.for("name")]: "RewriteIssued"
                                          },
                                          /* UpdateView */0,
                                          /* RewriteApplied */1
                                        ];
                                        var partial_arg$4 = [
                                          {
                                            _0: [],
                                            [Symbol.for("name")]: "RewriteIssued"
                                          },
                                          /* UpdateView */0,
                                          /* RewriteApplied */1
                                        ];
                                        var partial_arg$5 = [
                                          {
                                            _0: [],
                                            [Symbol.for("name")]: "RewriteIssued"
                                          },
                                          /* UpdateView */0,
                                          /* RewriteApplied */1
                                        ];
                                        var partial_arg$6 = [
                                          {
                                            _0: [[
                                                [
                                                  0,
                                                  6
                                                ],
                                                "λ"
                                              ]],
                                            [Symbol.for("name")]: "RewriteIssued"
                                          },
                                          /* UpdateView */0,
                                          /* RewriteApplied */1
                                        ];
                                        var partial_arg$7 = [
                                          {
                                            _0: [],
                                            [Symbol.for("name")]: "RewriteIssued"
                                          },
                                          /* UpdateView */0,
                                          /* RewriteApplied */1
                                        ];
                                        var partial_arg$8 = [
                                          {
                                            _0: [],
                                            [Symbol.for("name")]: "RewriteIssued"
                                          },
                                          /* UpdateView */0,
                                          /* RewriteApplied */1
                                        ];
                                        var partial_arg$9 = [
                                          {
                                            _0: [[
                                                [
                                                  0,
                                                  4
                                                ],
                                                "ƛ"
                                              ]],
                                            [Symbol.for("name")]: "RewriteIssued"
                                          },
                                          /* Deactivate */3,
                                          /* RewriteApplied */1
                                        ];
                                        return $$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk(activate(setup, undefined, undefined), (function (param) {
                                                                                                                                                                  return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg, param);
                                                                                                                                                                })), (function (param) {
                                                                                                                                                              return insertChar(setup, "l");
                                                                                                                                                            })), (function (param) {
                                                                                                                                                          return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$1, param);
                                                                                                                                                        })), (function (param) {
                                                                                                                                                      return Test__Util$AgdaModeVscode.A.equal("←", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                                                                                                                    })), (function (param) {
                                                                                                                                                  return insertChar(setup, "a");
                                                                                                                                                })), (function (param) {
                                                                                                                                              return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$2, param);
                                                                                                                                            })), (function (param) {
                                                                                                                                          return Test__Util$AgdaModeVscode.A.equal("←a", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                                                                                                        })), (function (param) {
                                                                                                                                      return insertChar(setup, "m");
                                                                                                                                    })), (function (param) {
                                                                                                                                  return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$3, param);
                                                                                                                                })), (function (param) {
                                                                                                                              return Test__Util$AgdaModeVscode.A.equal("←am", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                                                                                            })), (function (param) {
                                                                                                                          return insertChar(setup, "b");
                                                                                                                        })), (function (param) {
                                                                                                                      return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$4, param);
                                                                                                                    })), (function (param) {
                                                                                                                  return Test__Util$AgdaModeVscode.A.equal("←amb", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                                                                                })), (function (param) {
                                                                                                              return insertChar(setup, "d");
                                                                                                            })), (function (param) {
                                                                                                          return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$5, param);
                                                                                                        })), (function (param) {
                                                                                                      return Test__Util$AgdaModeVscode.A.equal("←ambd", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                                                                    })), (function (param) {
                                                                                                  return insertChar(setup, "a");
                                                                                                })), (function (param) {
                                                                                              return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$6, param);
                                                                                            })), (function (param) {
                                                                                          return Test__Util$AgdaModeVscode.A.equal("λ", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                                                        })), (function (param) {
                                                                                      return insertChar(setup, "b");
                                                                                    })), (function (param) {
                                                                                  return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$7, param);
                                                                                })), (function (param) {
                                                                              return Test__Util$AgdaModeVscode.A.equal("λb", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                                            })), (function (param) {
                                                                          return insertChar(setup, "a");
                                                                        })), (function (param) {
                                                                      return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$8, param);
                                                                    })), (function (param) {
                                                                  return Test__Util$AgdaModeVscode.A.equal("λba", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                                })), (function (param) {
                                                              return insertChar(setup, "r");
                                                            })), (function (param) {
                                                          return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$9, param);
                                                        })), (function (param) {
                                                      return Test__Util$AgdaModeVscode.A.equal("ƛ", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                    }));
                                      }));
                        }));
                  Test__Util$AgdaModeVscode.Q.it("should translate \"bn\" to \"𝕟\"", (function (param) {
                          return $$Promise.flatMapOk(acquire(setup), (function (setup) {
                                        var $$document = setup.editor.document;
                                        var partial_arg = [/* Activate */2];
                                        var partial_arg$1 = [
                                          {
                                            _0: [[
                                                [
                                                  0,
                                                  1
                                                ],
                                                "♭"
                                              ]],
                                            [Symbol.for("name")]: "RewriteIssued"
                                          },
                                          /* UpdateView */0,
                                          /* RewriteApplied */1
                                        ];
                                        var partial_arg$2 = [
                                          {
                                            _0: [[
                                                [
                                                  0,
                                                  2
                                                ],
                                                "𝕟"
                                              ]],
                                            [Symbol.for("name")]: "RewriteIssued"
                                          },
                                          /* Deactivate */3,
                                          /* RewriteApplied */1
                                        ];
                                        return $$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk(activate(setup, undefined, undefined), (function (param) {
                                                                              return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg, param);
                                                                            })), (function (param) {
                                                                          return insertChar(setup, "b");
                                                                        })), (function (param) {
                                                                      return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$1, param);
                                                                    })), (function (param) {
                                                                  return Test__Util$AgdaModeVscode.A.equal("♭", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                                })), (function (param) {
                                                              return insertChar(setup, "n");
                                                            })), (function (param) {
                                                          return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$2, param);
                                                        })), (function (param) {
                                                      return Test__Util$AgdaModeVscode.A.equal("𝕟", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                    }));
                                      }));
                        }));
                  return Test__Util$AgdaModeVscode.Q.it("Issue #55, should not deactivate when size of candidate symbols > 1", (function (param) {
                                return $$Promise.flatMapOk(acquire(setup), (function (setup) {
                                              var $$document = setup.editor.document;
                                              var partial_arg = [/* Activate */2];
                                              var partial_arg$1 = [
                                                {
                                                  _0: [],
                                                  [Symbol.for("name")]: "RewriteIssued"
                                                },
                                                /* UpdateView */0,
                                                /* RewriteApplied */1
                                              ];
                                              var partial_arg$2 = [
                                                {
                                                  _0: [],
                                                  [Symbol.for("name")]: "RewriteIssued"
                                                },
                                                /* UpdateView */0,
                                                /* RewriteApplied */1
                                              ];
                                              var partial_arg$3 = [
                                                {
                                                  _0: [[
                                                      [
                                                        0,
                                                        3
                                                      ],
                                                      "∗"
                                                    ]],
                                                  [Symbol.for("name")]: "RewriteIssued"
                                                },
                                                /* UpdateView */0,
                                                /* RewriteApplied */1
                                              ];
                                              var partial_arg$4 = [
                                                {
                                                  _0: [],
                                                  [Symbol.for("name")]: "RewriteIssued"
                                                },
                                                /* UpdateView */0,
                                                /* RewriteApplied */1
                                              ];
                                              var partial_arg$5 = [
                                                {
                                                  _0: [],
                                                  [Symbol.for("name")]: "RewriteIssued"
                                                },
                                                /* UpdateView */0,
                                                /* RewriteApplied */1
                                              ];
                                              var partial_arg$6 = [
                                                {
                                                  _0: [],
                                                  [Symbol.for("name")]: "RewriteIssued"
                                                },
                                                /* UpdateView */0,
                                                /* RewriteApplied */1
                                              ];
                                              var partial_arg$7 = [
                                                {
                                                  _0: [],
                                                  [Symbol.for("name")]: "RewriteIssued"
                                                },
                                                /* UpdateView */0,
                                                /* RewriteApplied */1
                                              ];
                                              var partial_arg$8 = [
                                                {
                                                  _0: [[
                                                      [
                                                        0,
                                                        6
                                                      ],
                                                      "⁎"
                                                    ]],
                                                  [Symbol.for("name")]: "RewriteIssued"
                                                },
                                                /* UpdateView */0,
                                                /* RewriteApplied */1
                                              ];
                                              var partial_arg$9 = [/* Deactivate */3];
                                              return $$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk(activate(setup, undefined, undefined), (function (param) {
                                                                                                                                                                        return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg, param);
                                                                                                                                                                      })), (function (param) {
                                                                                                                                                                    return insertChar(setup, "a");
                                                                                                                                                                  })), (function (param) {
                                                                                                                                                                return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$1, param);
                                                                                                                                                              })), (function (param) {
                                                                                                                                                            return Test__Util$AgdaModeVscode.A.equal("a", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                                                                                                                          })), (function (param) {
                                                                                                                                                        return insertChar(setup, "s");
                                                                                                                                                      })), (function (param) {
                                                                                                                                                    return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$2, param);
                                                                                                                                                  })), (function (param) {
                                                                                                                                                return Test__Util$AgdaModeVscode.A.equal("as", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                                                                                                              })), (function (param) {
                                                                                                                                            return insertChar(setup, "t");
                                                                                                                                          })), (function (param) {
                                                                                                                                        return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$3, param);
                                                                                                                                      })), (function (param) {
                                                                                                                                    return Test__Util$AgdaModeVscode.A.equal("∗", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                                                                                                  })), (function (param) {
                                                                                                                                return insertChar(setup, "e");
                                                                                                                              })), (function (param) {
                                                                                                                            return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$4, param);
                                                                                                                          })), (function (param) {
                                                                                                                        return Test__Util$AgdaModeVscode.A.equal("∗e", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                                                                                      })), (function (param) {
                                                                                                                    return insertChar(setup, "r");
                                                                                                                  })), (function (param) {
                                                                                                                return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$5, param);
                                                                                                              })), (function (param) {
                                                                                                            return Test__Util$AgdaModeVscode.A.equal("∗er", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                                                                          })), (function (param) {
                                                                                                        return insertChar(setup, "i");
                                                                                                      })), (function (param) {
                                                                                                    return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$6, param);
                                                                                                  })), (function (param) {
                                                                                                return Test__Util$AgdaModeVscode.A.equal("∗eri", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                                                              })), (function (param) {
                                                                                            return insertChar(setup, "s");
                                                                                          })), (function (param) {
                                                                                        return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$7, param);
                                                                                      })), (function (param) {
                                                                                    return Test__Util$AgdaModeVscode.A.equal("∗eris", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                                                  })), (function (param) {
                                                                                return insertChar(setup, "k");
                                                                              })), (function (param) {
                                                                            return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$8, param);
                                                                          })), (function (param) {
                                                                        return Test__Util$AgdaModeVscode.A.equal("⁎", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                                      })), (function (param) {
                                                                    return deactivate(setup);
                                                                  })), (function (param) {
                                                                return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$9, param);
                                                              })), (function (param) {
                                                            return Test__Util$AgdaModeVscode.A.equal("⁎", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                          }));
                                            }));
                              }));
                }));
          Mocha$BsMocha.describe("Backspacing")(undefined, undefined, undefined, (function (param) {
                  return Test__Util$AgdaModeVscode.Q.it("should work just fine", (function (param) {
                                return $$Promise.flatMapOk(acquire(setup), (function (setup) {
                                              var $$document = setup.editor.document;
                                              var partial_arg = [/* Activate */2];
                                              var partial_arg$1 = [
                                                {
                                                  _0: [[
                                                      [
                                                        0,
                                                        1
                                                      ],
                                                      "←"
                                                    ]],
                                                  [Symbol.for("name")]: "RewriteIssued"
                                                },
                                                /* UpdateView */0,
                                                /* RewriteApplied */1
                                              ];
                                              var partial_arg$2 = [
                                                {
                                                  _0: [],
                                                  [Symbol.for("name")]: "RewriteIssued"
                                                },
                                                /* UpdateView */0,
                                                /* RewriteApplied */1
                                              ];
                                              var partial_arg$3 = [
                                                {
                                                  _0: [[
                                                      [
                                                        0,
                                                        1
                                                      ],
                                                      "←"
                                                    ]],
                                                  [Symbol.for("name")]: "RewriteIssued"
                                                },
                                                /* UpdateView */0,
                                                /* RewriteApplied */1
                                              ];
                                              var partial_arg$4 = [
                                                {
                                                  _0: [],
                                                  [Symbol.for("name")]: "RewriteIssued"
                                                },
                                                /* UpdateView */0,
                                                /* RewriteApplied */1
                                              ];
                                              var partial_arg$5 = [
                                                {
                                                  _0: [],
                                                  [Symbol.for("name")]: "RewriteIssued"
                                                },
                                                /* UpdateView */0,
                                                /* RewriteApplied */1
                                              ];
                                              var partial_arg$6 = [
                                                {
                                                  _0: [],
                                                  [Symbol.for("name")]: "RewriteIssued"
                                                },
                                                /* UpdateView */0,
                                                /* RewriteApplied */1
                                              ];
                                              var partial_arg$7 = [
                                                {
                                                  _0: [],
                                                  [Symbol.for("name")]: "RewriteIssued"
                                                },
                                                /* UpdateView */0,
                                                /* RewriteApplied */1
                                              ];
                                              var partial_arg$8 = [
                                                {
                                                  _0: [[
                                                      [
                                                        0,
                                                        6
                                                      ],
                                                      "λ"
                                                    ]],
                                                  [Symbol.for("name")]: "RewriteIssued"
                                                },
                                                /* UpdateView */0,
                                                /* RewriteApplied */1
                                              ];
                                              var partial_arg$9 = [
                                                {
                                                  _0: [[
                                                      [
                                                        0,
                                                        0
                                                      ],
                                                      "lambd"
                                                    ]],
                                                  [Symbol.for("name")]: "RewriteIssued"
                                                },
                                                /* UpdateView */0,
                                                /* RewriteApplied */1
                                              ];
                                              var partial_arg$10 = [/* Deactivate */3];
                                              return $$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk(activate(setup, undefined, undefined), (function (param) {
                                                                                                                                                                                    return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg, param);
                                                                                                                                                                                  })), (function (param) {
                                                                                                                                                                                return insertChar(setup, "l");
                                                                                                                                                                              })), (function (param) {
                                                                                                                                                                            return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$1, param);
                                                                                                                                                                          })), (function (param) {
                                                                                                                                                                        return Test__Util$AgdaModeVscode.A.equal("←", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                                                                                                                                      })), (function (param) {
                                                                                                                                                                    return insertChar(setup, "a");
                                                                                                                                                                  })), (function (param) {
                                                                                                                                                                return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$2, param);
                                                                                                                                                              })), (function (param) {
                                                                                                                                                            return Test__Util$AgdaModeVscode.A.equal("←a", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                                                                                                                          })), (function (param) {
                                                                                                                                                        return backspace(setup);
                                                                                                                                                      })), (function (param) {
                                                                                                                                                    return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$3, param);
                                                                                                                                                  })), (function (param) {
                                                                                                                                                return Test__Util$AgdaModeVscode.A.equal("←", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                                                                                                              })), (function (param) {
                                                                                                                                            return insertChar(setup, "a");
                                                                                                                                          })), (function (param) {
                                                                                                                                        return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$4, param);
                                                                                                                                      })), (function (param) {
                                                                                                                                    return Test__Util$AgdaModeVscode.A.equal("←a", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                                                                                                  })), (function (param) {
                                                                                                                                return insertChar(setup, "m");
                                                                                                                              })), (function (param) {
                                                                                                                            return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$5, param);
                                                                                                                          })), (function (param) {
                                                                                                                        return Test__Util$AgdaModeVscode.A.equal("←am", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                                                                                      })), (function (param) {
                                                                                                                    return insertChar(setup, "b");
                                                                                                                  })), (function (param) {
                                                                                                                return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$6, param);
                                                                                                              })), (function (param) {
                                                                                                            return Test__Util$AgdaModeVscode.A.equal("←amb", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                                                                          })), (function (param) {
                                                                                                        return insertChar(setup, "d");
                                                                                                      })), (function (param) {
                                                                                                    return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$7, param);
                                                                                                  })), (function (param) {
                                                                                                return Test__Util$AgdaModeVscode.A.equal("←ambd", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                                                              })), (function (param) {
                                                                                            return insertChar(setup, "a");
                                                                                          })), (function (param) {
                                                                                        return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$8, param);
                                                                                      })), (function (param) {
                                                                                    return Test__Util$AgdaModeVscode.A.equal("λ", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                                                  })), (function (param) {
                                                                                return backspace(setup);
                                                                              })), (function (param) {
                                                                            return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$9, param);
                                                                          })), (function (param) {
                                                                        return Test__Util$AgdaModeVscode.A.equal("lambd", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                                      })), (function (param) {
                                                                    return deactivate(setup);
                                                                  })), (function (param) {
                                                                return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$10, param);
                                                              })), (function (param) {
                                                            return Test__Util$AgdaModeVscode.A.equal("lambd", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                          }));
                                            }));
                              }));
                }));
          Mocha$BsMocha.describe("Abortion")(undefined, undefined, undefined, (function (param) {
                  Test__Util$AgdaModeVscode.Q.it("should abort after hitting escape", (function (param) {
                          return $$Promise.flatMapOk(acquire(setup), (function (setup) {
                                        var $$document = setup.editor.document;
                                        var partial_arg = [/* Activate */2];
                                        var partial_arg$1 = [
                                          {
                                            _0: [[
                                                [
                                                  0,
                                                  1
                                                ],
                                                "♭"
                                              ]],
                                            [Symbol.for("name")]: "RewriteIssued"
                                          },
                                          /* UpdateView */0,
                                          /* RewriteApplied */1
                                        ];
                                        var partial_arg$2 = [/* Deactivate */3];
                                        return $$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk(activate(setup, undefined, undefined), (function (param) {
                                                                              return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg, param);
                                                                            })), (function (param) {
                                                                          return insertChar(setup, "b");
                                                                        })), (function (param) {
                                                                      return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$1, param);
                                                                    })), (function (param) {
                                                                  return Test__Util$AgdaModeVscode.A.equal("♭", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                                })), (function (param) {
                                                              return deactivate(setup);
                                                            })), (function (param) {
                                                          return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$2, param);
                                                        })), (function (param) {
                                                      return Test__Util$AgdaModeVscode.A.equal("♭", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                    }));
                                      }));
                        }));
                  Test__Util$AgdaModeVscode.Q.it("should abort after typing the wrong sequence", (function (param) {
                          return $$Promise.flatMapOk(acquire(setup), (function (setup) {
                                        var $$document = setup.editor.document;
                                        var partial_arg = [/* Activate */2];
                                        var partial_arg$1 = [
                                          {
                                            _0: [],
                                            [Symbol.for("name")]: "RewriteIssued"
                                          },
                                          /* UpdateView */0,
                                          /* RewriteApplied */1
                                        ];
                                        var partial_arg$2 = [
                                          {
                                            _0: [],
                                            [Symbol.for("name")]: "RewriteIssued"
                                          },
                                          /* Deactivate */3,
                                          /* RewriteApplied */1
                                        ];
                                        return $$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk(activate(setup, undefined, undefined), (function (param) {
                                                                              return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg, param);
                                                                            })), (function (param) {
                                                                          return insertChar(setup, "a");
                                                                        })), (function (param) {
                                                                      return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$1, param);
                                                                    })), (function (param) {
                                                                  return Test__Util$AgdaModeVscode.A.equal("a", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                                })), (function (param) {
                                                              return insertChar(setup, "d");
                                                            })), (function (param) {
                                                          return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$2, param);
                                                        })), (function (param) {
                                                      return Test__Util$AgdaModeVscode.A.equal("ad", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                    }));
                                      }));
                        }));
                  return Test__Util$AgdaModeVscode.Q.it("should abort after backspacing to much", (function (param) {
                                return $$Promise.flatMapOk(acquire(setup), (function (setup) {
                                              var $$document = setup.editor.document;
                                              var partial_arg = [/* Activate */2];
                                              var partial_arg$1 = [
                                                {
                                                  _0: [],
                                                  [Symbol.for("name")]: "RewriteIssued"
                                                },
                                                /* UpdateView */0,
                                                /* RewriteApplied */1
                                              ];
                                              var partial_arg$2 = [
                                                {
                                                  _0: [[
                                                      [
                                                        0,
                                                        0
                                                      ],
                                                      ""
                                                    ]],
                                                  [Symbol.for("name")]: "RewriteIssued"
                                                },
                                                /* Deactivate */3,
                                                /* RewriteApplied */1
                                              ];
                                              return $$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk(activate(setup, undefined, undefined), (function (param) {
                                                                                    return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg, param);
                                                                                  })), (function (param) {
                                                                                return insertChar(setup, "a");
                                                                              })), (function (param) {
                                                                            return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$1, param);
                                                                          })), (function (param) {
                                                                        return Test__Util$AgdaModeVscode.A.equal("a", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                                      })), (function (param) {
                                                                    return backspace(setup);
                                                                  })), (function (param) {
                                                                return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$2, param);
                                                              })), (function (param) {
                                                            return Test__Util$AgdaModeVscode.A.equal("", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                          }));
                                            }));
                              }));
                }));
          Mocha$BsMocha.describe("Cursor")(undefined, undefined, undefined, (function (param) {
                  Test__Util$AgdaModeVscode.Q.it("should not abort when the cursor is placed inside the buffer", (function (param) {
                          return $$Promise.flatMapOk(acquire(setup), (function (setup) {
                                        var $$document = setup.editor.document;
                                        var partial_arg = [/* Activate */2];
                                        var partial_arg$1 = [
                                          {
                                            _0: [],
                                            [Symbol.for("name")]: "RewriteIssued"
                                          },
                                          /* UpdateView */0,
                                          /* RewriteApplied */1
                                        ];
                                        var partial_arg$2 = [
                                          {
                                            _0: [],
                                            [Symbol.for("name")]: "RewriteIssued"
                                          },
                                          /* UpdateView */0,
                                          /* RewriteApplied */1
                                        ];
                                        var partial_arg$3 = [
                                          {
                                            _0: [[
                                                [
                                                  0,
                                                  3
                                                ],
                                                "∧"
                                              ]],
                                            [Symbol.for("name")]: "RewriteIssued"
                                          },
                                          /* UpdateView */0,
                                          /* RewriteApplied */1
                                        ];
                                        var partial_arg$4 = [
                                          {
                                            _0: [[
                                                [
                                                  0,
                                                  2
                                                ],
                                                "≙"
                                              ]],
                                            [Symbol.for("name")]: "RewriteIssued"
                                          },
                                          /* Deactivate */3,
                                          /* RewriteApplied */1
                                        ];
                                        return $$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk(activate(setup, undefined, undefined), (function (param) {
                                                                                                                          return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg, param);
                                                                                                                        })), (function (param) {
                                                                                                                      return insertChar(setup, "a");
                                                                                                                    })), (function (param) {
                                                                                                                  return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$1, param);
                                                                                                                })), (function (param) {
                                                                                                              return Test__Util$AgdaModeVscode.A.equal("a", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                                                                            })), (function (param) {
                                                                                                          return insertChar(setup, "n");
                                                                                                        })), (function (param) {
                                                                                                      return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$2, param);
                                                                                                    })), (function (param) {
                                                                                                  return Test__Util$AgdaModeVscode.A.equal("an", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                                                                })), (function (param) {
                                                                                              return select(setup, [[
                                                                                                            0,
                                                                                                            0
                                                                                                          ]]);
                                                                                            })), (function (param) {
                                                                                          return select(setup, [[
                                                                                                        1,
                                                                                                        1
                                                                                                      ]]);
                                                                                        })), (function (param) {
                                                                                      return select(setup, [[
                                                                                                    2,
                                                                                                    2
                                                                                                  ]]);
                                                                                    })), (function (param) {
                                                                                  return select(setup, [
                                                                                              [
                                                                                                0,
                                                                                                1
                                                                                              ],
                                                                                              [
                                                                                                1,
                                                                                                2
                                                                                              ]
                                                                                            ]);
                                                                                })), (function (param) {
                                                                              return select(setup, [[
                                                                                            0,
                                                                                            2
                                                                                          ]]);
                                                                            })), (function (param) {
                                                                          return insertChar(setup, "d");
                                                                        })), (function (param) {
                                                                      return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$3, param);
                                                                    })), (function (param) {
                                                                  return Test__Util$AgdaModeVscode.A.equal("∧", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                                })), (function (param) {
                                                              return insertChar(setup, "=");
                                                            })), (function (param) {
                                                          return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$4, param);
                                                        })), (function (param) {
                                                      return Test__Util$AgdaModeVscode.A.equal("≙", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                    }));
                                      }));
                        }));
                  return Test__Util$AgdaModeVscode.Q.it("should abort when the cursor is placed outside the buffer", (function (param) {
                                return $$Promise.flatMapOk(acquire(setup), (function (setup) {
                                              var positions = [new Vscode.Position(0, 3)];
                                              var $$document = setup.editor.document;
                                              var partial_arg = [/* Activate */2];
                                              var partial_arg$1 = [
                                                {
                                                  _0: [],
                                                  [Symbol.for("name")]: "RewriteIssued"
                                                },
                                                /* UpdateView */0,
                                                /* RewriteApplied */1
                                              ];
                                              var partial_arg$2 = [
                                                {
                                                  _0: [],
                                                  [Symbol.for("name")]: "RewriteIssued"
                                                },
                                                /* UpdateView */0,
                                                /* RewriteApplied */1
                                              ];
                                              var partial_arg$3 = [/* Deactivate */3];
                                              return $$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMap(Editor$AgdaModeVscode.$$Text.insert($$document, new Vscode.Position(0, 0), "123"), (function (param) {
                                                                                                return activate(setup, positions, undefined);
                                                                                              })), (function (param) {
                                                                                            return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg, param);
                                                                                          })), (function (param) {
                                                                                        return insertChar(setup, "a");
                                                                                      })), (function (param) {
                                                                                    return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$1, param);
                                                                                  })), (function (param) {
                                                                                return Test__Util$AgdaModeVscode.A.equal("123a", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                                              })), (function (param) {
                                                                            return insertChar(setup, "n");
                                                                          })), (function (param) {
                                                                        return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$2, param);
                                                                      })), (function (param) {
                                                                    return Test__Util$AgdaModeVscode.A.equal("123an", Editor$AgdaModeVscode.$$Text.getAll($$document));
                                                                  })), (function (param) {
                                                                return selectAndWait(setup, [[
                                                                              1,
                                                                              1
                                                                            ]]);
                                                              })), (function (param) {
                                                            return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$3, param);
                                                          }));
                                            }));
                              }));
                }));
          return Mocha$BsMocha.describe("Multiple cursors at once")(undefined, undefined, undefined, (function (param) {
                        var partial_arg = /\r\n/g;
                        var replaceCRLF = function (param) {
                          return param.replace(partial_arg, "\n");
                        };
                        Test__Util$AgdaModeVscode.Q.it("should work just fine (𝕟)", (function (param) {
                                var positions = [
                                  new Vscode.Position(0, 0),
                                  new Vscode.Position(1, 0),
                                  new Vscode.Position(2, 0),
                                  new Vscode.Position(3, 0)
                                ];
                                return $$Promise.flatMapOk(acquire(setup), (function (setup) {
                                              var $$document = setup.editor.document;
                                              var partial_arg = [/* Activate */2];
                                              return $$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMap(Editor$AgdaModeVscode.$$Text.insert($$document, new Vscode.Position(0, 0), "\n\n\n"), (function (param) {
                                                                                        return activate(setup, positions, undefined);
                                                                                      })), (function (param) {
                                                                                    return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg, param);
                                                                                  })), (function (param) {
                                                                                return insertChar(setup, "b");
                                                                              })), (function (actual) {
                                                                            if (Test__Util$AgdaModeVscode.onUnix) {
                                                                              var xs = [
                                                                                {
                                                                                  _0: [
                                                                                    [
                                                                                      [
                                                                                        0,
                                                                                        1
                                                                                      ],
                                                                                      "♭"
                                                                                    ],
                                                                                    [
                                                                                      [
                                                                                        2,
                                                                                        3
                                                                                      ],
                                                                                      "♭"
                                                                                    ],
                                                                                    [
                                                                                      [
                                                                                        4,
                                                                                        5
                                                                                      ],
                                                                                      "♭"
                                                                                    ],
                                                                                    [
                                                                                      [
                                                                                        6,
                                                                                        7
                                                                                      ],
                                                                                      "♭"
                                                                                    ]
                                                                                  ],
                                                                                  [Symbol.for("name")]: "RewriteIssued"
                                                                                },
                                                                                /* UpdateView */0,
                                                                                /* RewriteApplied */1
                                                                              ];
                                                                              return Test__Util$AgdaModeVscode.A.deep_equal(xs, actual);
                                                                            }
                                                                            var xs$1 = [
                                                                              {
                                                                                _0: [
                                                                                  [
                                                                                    [
                                                                                      0,
                                                                                      1
                                                                                    ],
                                                                                    "♭"
                                                                                  ],
                                                                                  [
                                                                                    [
                                                                                      3,
                                                                                      4
                                                                                    ],
                                                                                    "♭"
                                                                                  ],
                                                                                  [
                                                                                    [
                                                                                      6,
                                                                                      7
                                                                                    ],
                                                                                    "♭"
                                                                                  ],
                                                                                  [
                                                                                    [
                                                                                      9,
                                                                                      10
                                                                                    ],
                                                                                    "♭"
                                                                                  ]
                                                                                ],
                                                                                [Symbol.for("name")]: "RewriteIssued"
                                                                              },
                                                                              /* UpdateView */0,
                                                                              /* RewriteApplied */1
                                                                            ];
                                                                            return Test__Util$AgdaModeVscode.A.deep_equal(xs$1, actual);
                                                                          })), (function (param) {
                                                                        return Test__Util$AgdaModeVscode.A.equal("♭\n♭\n♭\n♭", Curry._1(replaceCRLF, Editor$AgdaModeVscode.$$Text.getAll($$document)));
                                                                      })), (function (param) {
                                                                    return insertChar(setup, "n");
                                                                  })), (function (actual) {
                                                                if (Test__Util$AgdaModeVscode.onUnix) {
                                                                  var xs = [
                                                                    {
                                                                      _0: [
                                                                        [
                                                                          [
                                                                            0,
                                                                            2
                                                                          ],
                                                                          "𝕟"
                                                                        ],
                                                                        [
                                                                          [
                                                                            3,
                                                                            5
                                                                          ],
                                                                          "𝕟"
                                                                        ],
                                                                        [
                                                                          [
                                                                            6,
                                                                            8
                                                                          ],
                                                                          "𝕟"
                                                                        ],
                                                                        [
                                                                          [
                                                                            9,
                                                                            11
                                                                          ],
                                                                          "𝕟"
                                                                        ]
                                                                      ],
                                                                      [Symbol.for("name")]: "RewriteIssued"
                                                                    },
                                                                    /* Deactivate */3,
                                                                    /* RewriteApplied */1
                                                                  ];
                                                                  return Test__Util$AgdaModeVscode.A.deep_equal(xs, actual);
                                                                }
                                                                var xs$1 = [
                                                                  {
                                                                    _0: [
                                                                      [
                                                                        [
                                                                          0,
                                                                          2
                                                                        ],
                                                                        "𝕟"
                                                                      ],
                                                                      [
                                                                        [
                                                                          4,
                                                                          6
                                                                        ],
                                                                        "𝕟"
                                                                      ],
                                                                      [
                                                                        [
                                                                          8,
                                                                          10
                                                                        ],
                                                                        "𝕟"
                                                                      ],
                                                                      [
                                                                        [
                                                                          12,
                                                                          14
                                                                        ],
                                                                        "𝕟"
                                                                      ]
                                                                    ],
                                                                    [Symbol.for("name")]: "RewriteIssued"
                                                                  },
                                                                  /* Deactivate */3,
                                                                  /* RewriteApplied */1
                                                                ];
                                                                return Test__Util$AgdaModeVscode.A.deep_equal(xs$1, actual);
                                                              })), (function (param) {
                                                            return Test__Util$AgdaModeVscode.A.equal("𝕟\n𝕟\n𝕟\n𝕟", Curry._1(replaceCRLF, Editor$AgdaModeVscode.$$Text.getAll($$document)));
                                                          }));
                                            }));
                              }));
                        return Test__Util$AgdaModeVscode.Q.it("should work just fine (∧)", (function (param) {
                                      return $$Promise.flatMapOk(acquire(setup), (function (setup) {
                                                    var positions = [
                                                      new Vscode.Position(0, 0),
                                                      new Vscode.Position(1, 1),
                                                      new Vscode.Position(2, 2),
                                                      new Vscode.Position(3, 3)
                                                    ];
                                                    var $$document = setup.editor.document;
                                                    var partial_arg = [/* Activate */2];
                                                    var partial_arg$1 = [
                                                      {
                                                        _0: [],
                                                        [Symbol.for("name")]: "RewriteIssued"
                                                      },
                                                      /* UpdateView */0,
                                                      /* RewriteApplied */1
                                                    ];
                                                    var partial_arg$2 = [
                                                      {
                                                        _0: [],
                                                        [Symbol.for("name")]: "RewriteIssued"
                                                      },
                                                      /* UpdateView */0,
                                                      /* RewriteApplied */1
                                                    ];
                                                    return $$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMapOk($$Promise.flatMap(Editor$AgdaModeVscode.$$Text.insert($$document, new Vscode.Position(0, 0), "123\n123\n123\n123"), (function (param) {
                                                                                                          return activate(setup, positions, undefined);
                                                                                                        })), (function (param) {
                                                                                                      return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg, param);
                                                                                                    })), (function (param) {
                                                                                                  return insertChar(setup, "a");
                                                                                                })), (function (param) {
                                                                                              return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$1, param);
                                                                                            })), (function (param) {
                                                                                          return Test__Util$AgdaModeVscode.A.equal("a123\n1a23\n12a3\n123a", Curry._1(replaceCRLF, Editor$AgdaModeVscode.$$Text.getAll($$document)));
                                                                                        })), (function (param) {
                                                                                      return insertChar(setup, "n");
                                                                                    })), (function (param) {
                                                                                  return Test__Util$AgdaModeVscode.A.deep_equal(partial_arg$2, param);
                                                                                })), (function (param) {
                                                                              return Test__Util$AgdaModeVscode.A.equal("an123\n1an23\n12an3\n123an", Curry._1(replaceCRLF, Editor$AgdaModeVscode.$$Text.getAll($$document)));
                                                                            })), (function (param) {
                                                                          return insertChar(setup, "d");
                                                                        })), (function (actual) {
                                                                      if (Test__Util$AgdaModeVscode.onUnix) {
                                                                        var xs = [
                                                                          {
                                                                            _0: [
                                                                              [
                                                                                [
                                                                                  0,
                                                                                  3
                                                                                ],
                                                                                "∧"
                                                                              ],
                                                                              [
                                                                                [
                                                                                  8,
                                                                                  11
                                                                                ],
                                                                                "∧"
                                                                              ],
                                                                              [
                                                                                [
                                                                                  16,
                                                                                  19
                                                                                ],
                                                                                "∧"
                                                                              ],
                                                                              [
                                                                                [
                                                                                  24,
                                                                                  27
                                                                                ],
                                                                                "∧"
                                                                              ]
                                                                            ],
                                                                            [Symbol.for("name")]: "RewriteIssued"
                                                                          },
                                                                          /* UpdateView */0,
                                                                          /* RewriteApplied */1
                                                                        ];
                                                                        return Test__Util$AgdaModeVscode.A.deep_equal(xs, actual);
                                                                      }
                                                                      var xs$1 = [
                                                                        {
                                                                          _0: [
                                                                            [
                                                                              [
                                                                                0,
                                                                                3
                                                                              ],
                                                                              "∧"
                                                                            ],
                                                                            [
                                                                              [
                                                                                9,
                                                                                12
                                                                              ],
                                                                              "∧"
                                                                            ],
                                                                            [
                                                                              [
                                                                                18,
                                                                                21
                                                                              ],
                                                                              "∧"
                                                                            ],
                                                                            [
                                                                              [
                                                                                27,
                                                                                30
                                                                              ],
                                                                              "∧"
                                                                            ]
                                                                          ],
                                                                          [Symbol.for("name")]: "RewriteIssued"
                                                                        },
                                                                        /* UpdateView */0,
                                                                        /* RewriteApplied */1
                                                                      ];
                                                                      return Test__Util$AgdaModeVscode.A.deep_equal(xs$1, actual);
                                                                    })), (function (param) {
                                                                  return Test__Util$AgdaModeVscode.A.equal("∧123\n1∧23\n12∧3\n123∧", Curry._1(replaceCRLF, Editor$AgdaModeVscode.$$Text.getAll($$document)));
                                                                }));
                                                  }));
                                    }));
                      }));
        }));
  
  var Js$prime;
  
  var Js;
  
  exports.Js$prime = Js$prime;
  exports.Js = Js;
  exports.activateExtension = activateExtension;
  exports.acquire = acquire;
  exports.cleanup = cleanup;
  exports.IM = IM;
  /*  Not a pure module */
  