"undefined"!=typeof process&&require("amd-loader"),define(function(a,b,c){"use strict";function h(a){var b=[];return a.ranges.forEach(function(a){b.push(a.start.row,a.start.column,a.end.row,a.end.column)}),b}function i(a,b){g.equal(""+h(a),""+b)}var d=a("./range").Range,e=a("./range_list").RangeList,g=(a("./edit_session").EditSession,a("./test/assertions"));c.exports={name:"ACE range_list.js","test: rangeList pointIndex":function(){var a=new e;a.ranges=[new d(1,2,3,4),new d(4,2,5,4),new d(8,8,9,9)],g.equal(a.pointIndex({row:0,column:1}),-1),g.equal(a.pointIndex({row:1,column:2}),0),g.equal(a.pointIndex({row:1,column:3}),0),g.equal(a.pointIndex({row:3,column:4}),0),g.equal(a.pointIndex({row:4,column:1}),-2),g.equal(a.pointIndex({row:5,column:1}),1),g.equal(a.pointIndex({row:8,column:9}),2),g.equal(a.pointIndex({row:18,column:9}),-4)},"test: rangeList pointIndex excludeEdges":function(){var a=new e;a.ranges=[new d(1,2,3,4),new d(4,2,5,4),new d(8,8,9,9),new d(10,10,10,10)],g.equal(a.pointIndex({row:0,column:1},!0),-1),g.equal(a.pointIndex({row:1,column:2},!0),-1),g.equal(a.pointIndex({row:1,column:3},!0),0),g.equal(a.pointIndex({row:3,column:4},!0),-2),g.equal(a.pointIndex({row:4,column:1},!0),-2),g.equal(a.pointIndex({row:5,column:1},!0),1),g.equal(a.pointIndex({row:8,column:9},!0),2),g.equal(a.pointIndex({row:10,column:10},!0),3),g.equal(a.pointIndex({row:18,column:9},!0),-5)},"test: rangeList add":function(){var a=new e;a.addList([new d(9,0,9,1),new d(1,2,3,4),new d(8,8,9,9),new d(4,2,5,4),new d(3,20,3,24),new d(6,6,7,7)]),g.equal(a.ranges.length,5),a.add(new d(1,2,3,5)),g.range(a.ranges[0],1,2,3,5),g.equal(a.ranges.length,5),a.add(new d(7,7,7,7)),g.range(a.ranges[3],7,7,7,7),a.add(new d(7,8,7,8)),g.range(a.ranges[4],7,8,7,8)},"test: rangeList add empty":function(){var a=new e;a.addList([new d(7,10,7,10),new d(9,10,9,10),new d(8,10,8,10)]),g.equal(a.ranges.length,3),a.add(new d(9,10,9,10)),i(a,[7,10,7,10,8,10,8,10,9,10,9,10])},"test: rangeList merge":function(){var a=new e;a.addList([new d(1,2,3,4),new d(4,2,5,4),new d(6,6,7,7),new d(8,8,9,9)]);var b=[];g.equal(a.ranges.length,4),a.ranges[1].end.row=7,b=a.merge(),g.equal(b.length,1),g.range(a.ranges[1],4,2,7,7),g.equal(a.ranges.length,3),a.ranges[0].end.row=10,b=a.merge(),g.range(a.ranges[0],1,2,10,4),g.equal(b.length,2),g.equal(a.ranges.length,1),a.ranges.push(new d(10,10,10,10)),a.ranges.push(new d(10,10,10,10)),b=a.merge(),g.equal(a.ranges.length,2)},"test: rangeList remove":function(){var a=new e,b=[new d(1,2,3,4),new d(4,2,5,4),new d(6,6,7,7),new d(8,8,9,9)];a.addList(b),g.equal(a.ranges.length,4),a.substractPoint({row:1,column:2}),g.equal(a.ranges.length,3),a.substractPoint({row:6,column:7}),g.equal(a.ranges.length,2)}}}),"undefined"!=typeof module&&module===require.main&&require("asyncjs").test.testcase(module.exports).exec();