]> git.mdlowis.com Git - archive/tide-ocaml.git/commitdiff
fleshed out tests for rope module
authorMichael D. Lowis <mike@mdlowis.com>
Tue, 14 Nov 2017 02:15:44 +0000 (21:15 -0500)
committerMichael D. Lowis <mike@mdlowis.com>
Tue, 14 Nov 2017 02:15:44 +0000 (21:15 -0500)
23 files changed:
docs/Buf.Cursor.html
docs/Buf.html
docs/Cfg.Color.Syntax.html
docs/Cfg.Color.html
docs/Cfg.html
docs/Draw.Cursor.html
docs/Draw.html
docs/Misc.html
docs/Rope.html
docs/Scrollmap.html
docs/View.html
docs/X11.GlyphMap.html
docs/X11.Rune.html
docs/X11.html
docs/index.html
docs/index_exceptions.html
docs/index_modules.html
docs/index_types.html
docs/index_values.html
docs/type_X11.GlyphMap.html
lib/rope.ml
lib/rope.mli
tests/rope_tests.ml

index f55b43bac11c95e8eaebaa733b6ed7a4c32fcd91..2952d512d923bcb7ea87d72df8db4ac0b6daaeec 100644 (file)
@@ -24,7 +24,7 @@
 &nbsp;</div>
 <h1>Module <a href="type_Buf.Cursor.html">Buf.Cursor</a></h1>
 
-<pre><span class="keyword">module</span> Cursor: <code class="code">sig</code> <a href="Buf.Cursor.html">..</a> <code class="code">end</code></pre><hr width="100%">
+<pre><span id="MODULECursor"><span class="keyword">module</span> Cursor</span>: <code class="code">sig</code> <a href="Buf.Cursor.html">..</a> <code class="code">end</code></pre><hr width="100%">
 
 <pre><code><span id="TYPEcsr"><span class="keyword">type</span> <code class="type"></code>csr</span> = {</code></pre><table class="typetable">
 <tr>
index fef0b3986c931c2906465084f23714bb2a805277..2b5147f9e7be80a1ad45392ba8753c4902598854 100644 (file)
@@ -28,7 +28,7 @@
 </div>
 <h1>Module <a href="type_Buf.html">Buf</a></h1>
 
-<pre><span class="keyword">module</span> Buf: <code class="code">sig</code> <a href="Buf.html">..</a> <code class="code">end</code></pre><hr width="100%">
+<pre><span id="MODULEBuf"><span class="keyword">module</span> Buf</span>: <code class="code">sig</code> <a href="Buf.html">..</a> <code class="code">end</code></pre><hr width="100%">
 
 <pre><code><span id="TYPEbuf"><span class="keyword">type</span> <code class="type"></code>buf</span> = {</code></pre><table class="typetable">
 <tr>
 <pre><span id="VALlength"><span class="keyword">val</span> length</span> : <code class="type"><a href="Buf.html#TYPEbuf">buf</a> -> int</code></pre>
 <pre><span id="VALiteri"><span class="keyword">val</span> iteri</span> : <code class="type">(int -> <a href="Rope.html#TYPErune">Rope.rune</a> -> bool) -> <a href="Buf.html#TYPEbuf">buf</a> -> int -> unit</code></pre>
 <pre><span id="VALiter"><span class="keyword">val</span> iter</span> : <code class="type">(<a href="Rope.html#TYPErune">Rope.rune</a> -> bool) -> <a href="Buf.html#TYPEbuf">buf</a> -> int -> unit</code></pre>
-<pre><span class="keyword">module</span> <a href="Buf.Cursor.html">Cursor</a>: <code class="code">sig</code> <a href="Buf.Cursor.html">..</a> <code class="code">end</code></pre>
+<pre><span id="MODULECursor"><span class="keyword">module</span> <a href="Buf.Cursor.html">Cursor</a></span>: <code class="code">sig</code> <a href="Buf.Cursor.html">..</a> <code class="code">end</code></pre>
 <pre><span id="VALmove_to"><span class="keyword">val</span> move_to</span> : <code class="type"><a href="Buf.html#TYPEdest">dest</a> -> <a href="Buf.html#TYPEbuf">buf</a> -> int -> int</code></pre>
 <pre><span id="VALnextc"><span class="keyword">val</span> nextc</span> : <code class="type"><a href="Buf.html#TYPEbuf">buf</a> -> int -> int</code></pre>
 <pre><span id="VALprevc"><span class="keyword">val</span> prevc</span> : <code class="type"><a href="Buf.html#TYPEbuf">buf</a> -> int -> int</code></pre>
index 4e24f31169fa1af07383b6d34dcc63c2e9d7ebf4..1d69c7a67b9fc10605bbe7f190dbe37610187aed 100644 (file)
@@ -24,7 +24,7 @@
 &nbsp;</div>
 <h1>Module <a href="type_Cfg.Color.Syntax.html">Cfg.Color.Syntax</a></h1>
 
-<pre><span class="keyword">module</span> Syntax: <code class="code">sig</code> <a href="Cfg.Color.Syntax.html">..</a> <code class="code">end</code></pre><hr width="100%">
+<pre><span id="MODULESyntax"><span class="keyword">module</span> Syntax</span>: <code class="code">sig</code> <a href="Cfg.Color.Syntax.html">..</a> <code class="code">end</code></pre><hr width="100%">
 
 <pre><span id="VALnormal"><span class="keyword">val</span> normal</span> : <code class="type">int</code></pre>
 <pre><span id="VALcomment"><span class="keyword">val</span> comment</span> : <code class="type">int</code></pre>
index 71da95216e8e90e3ce6df16e2f7c34c460223fc7..0ae0ac9aa131c0ff5e907fae0bf488007ec0b2a3 100644 (file)
@@ -24,7 +24,7 @@
 &nbsp;</div>
 <h1>Module <a href="type_Cfg.Color.html">Cfg.Color</a></h1>
 
-<pre><span class="keyword">module</span> Color: <code class="code">sig</code> <a href="Cfg.Color.html">..</a> <code class="code">end</code></pre><hr width="100%">
+<pre><span id="MODULEColor"><span class="keyword">module</span> Color</span>: <code class="code">sig</code> <a href="Cfg.Color.html">..</a> <code class="code">end</code></pre><hr width="100%">
 
 <pre><span id="VALpalette"><span class="keyword">val</span> palette</span> : <code class="type">int array</code></pre>
 <pre><span id="VALscroll_nor"><span class="keyword">val</span> scroll_nor</span> : <code class="type">int * int</code></pre>
@@ -39,4 +39,4 @@
 <pre><span id="VALedit_csr"><span class="keyword">val</span> edit_csr</span> : <code class="type">int</code></pre>
 <pre><span id="VALedit_rul"><span class="keyword">val</span> edit_rul</span> : <code class="type">int</code></pre>
 <pre><span id="VALborders"><span class="keyword">val</span> borders</span> : <code class="type">int * int</code></pre>
-<pre><span class="keyword">module</span> <a href="Cfg.Color.Syntax.html">Syntax</a>: <code class="code">sig</code> <a href="Cfg.Color.Syntax.html">..</a> <code class="code">end</code></pre></body></html>
\ No newline at end of file
+<pre><span id="MODULESyntax"><span class="keyword">module</span> <a href="Cfg.Color.Syntax.html">Syntax</a></span>: <code class="code">sig</code> <a href="Cfg.Color.Syntax.html">..</a> <code class="code">end</code></pre></body></html>
\ No newline at end of file
index 6a81cb1bc3cd658194acee129428c6ff4881c7d8..b566741c6684651f3ac6520a93bd7c3b12da073b 100644 (file)
@@ -28,7 +28,7 @@
 </div>
 <h1>Module <a href="type_Cfg.html">Cfg</a></h1>
 
-<pre><span class="keyword">module</span> Cfg: <code class="code">sig</code> <a href="Cfg.html">..</a> <code class="code">end</code></pre><hr width="100%">
+<pre><span id="MODULECfg"><span class="keyword">module</span> Cfg</span>: <code class="code">sig</code> <a href="Cfg.html">..</a> <code class="code">end</code></pre><hr width="100%">
 
 <pre><span id="VALboolvar"><span class="keyword">val</span> boolvar</span> : <code class="type">string -> bool -> bool</code></pre>
 <pre><span id="VALintvar"><span class="keyword">val</span> intvar</span> : <code class="type">string -> int -> int</code></pre>
@@ -51,4 +51,4 @@
 <pre><span id="VALscroll_lines"><span class="keyword">val</span> scroll_lines</span> : <code class="type">int</code></pre>
 <pre><span id="VALdbl_click_time"><span class="keyword">val</span> dbl_click_time</span> : <code class="type">int</code></pre>
 <pre><span id="VALmax_scan_dist"><span class="keyword">val</span> max_scan_dist</span> : <code class="type">int</code></pre>
-<pre><span class="keyword">module</span> <a href="Cfg.Color.html">Color</a>: <code class="code">sig</code> <a href="Cfg.Color.html">..</a> <code class="code">end</code></pre></body></html>
\ No newline at end of file
+<pre><span id="MODULEColor"><span class="keyword">module</span> <a href="Cfg.Color.html">Color</a></span>: <code class="code">sig</code> <a href="Cfg.Color.html">..</a> <code class="code">end</code></pre></body></html>
\ No newline at end of file
index 6dd4c398ac2dedc1cbc8c42a5ec5d4d404c42950..425675f1fffc38ad288ef2902b19f19ed58a6fa0 100644 (file)
@@ -24,7 +24,7 @@
 &nbsp;</div>
 <h1>Module <a href="type_Draw.Cursor.html">Draw.Cursor</a></h1>
 
-<pre><span class="keyword">module</span> Cursor: <code class="code">sig</code> <a href="Draw.Cursor.html">..</a> <code class="code">end</code></pre><hr width="100%">
+<pre><span id="MODULECursor"><span class="keyword">module</span> Cursor</span>: <code class="code">sig</code> <a href="Draw.Cursor.html">..</a> <code class="code">end</code></pre><hr width="100%">
 
 <pre><code><span id="TYPEt"><span class="keyword">type</span> <code class="type"></code>t</span> = {</code></pre><table class="typetable">
 <tr>
index 92f03a4cae7cfe7babb22e766f4c967eebfe34e8..409af292ac835758d4b164e0c9fb9f64f6459282 100644 (file)
 </div>
 <h1>Module <a href="type_Draw.html">Draw</a></h1>
 
-<pre><span class="keyword">module</span> Draw: <code class="code">sig</code> <a href="Draw.html">..</a> <code class="code">end</code></pre><hr width="100%">
+<pre><span id="MODULEDraw"><span class="keyword">module</span> Draw</span>: <code class="code">sig</code> <a href="Draw.html">..</a> <code class="code">end</code></pre><hr width="100%">
 
 <pre><span id="VALfont"><span class="keyword">val</span> font</span> : <code class="type"><a href="X11.html#TYPEfont">X11.font</a></code></pre>
 <pre><span id="VALfont_height"><span class="keyword">val</span> font_height</span> : <code class="type">int</code></pre>
 <pre><span id="VALtabglyph"><span class="keyword">val</span> tabglyph</span> : <code class="type">int</code></pre>
 <pre><span id="VALtabwidth"><span class="keyword">val</span> tabwidth</span> : <code class="type">int</code></pre>
 <pre><span id="VALglyph_width"><span class="keyword">val</span> glyph_width</span> : <code class="type"><a href="X11.html#TYPEglyph">X11.glyph</a> -> int</code></pre>
-<pre><span class="keyword">module</span> <a href="Draw.Cursor.html">Cursor</a>: <code class="code">sig</code> <a href="Draw.Cursor.html">..</a> <code class="code">end</code></pre>
+<pre><span id="MODULECursor"><span class="keyword">module</span> <a href="Draw.Cursor.html">Cursor</a></span>: <code class="code">sig</code> <a href="Draw.Cursor.html">..</a> <code class="code">end</code></pre>
 <pre><span id="VALrectangle"><span class="keyword">val</span> rectangle</span> : <code class="type">int -> int -> int -> <a href="Draw.Cursor.html#TYPEt">Cursor.t</a> -> unit</code></pre>
 <pre><span id="VALdark_bkg"><span class="keyword">val</span> dark_bkg</span> : <code class="type">int -> int -> <a href="Draw.Cursor.html#TYPEt">Cursor.t</a> -> unit</code></pre>
 <pre><span id="VALlight_bkg"><span class="keyword">val</span> light_bkg</span> : <code class="type">int -> int -> <a href="Draw.Cursor.html#TYPEt">Cursor.t</a> -> unit</code></pre>
index 3f975b489d66e6e0e471a023394f23affe9c6bb1..287bd85b5c3c0f2097cdd3523e4449ee916c1049 100644 (file)
@@ -26,6 +26,6 @@
 </div>
 <h1>Module <a href="type_Misc.html">Misc</a></h1>
 
-<pre><span class="keyword">module</span> Misc: <code class="code">sig</code> <a href="Misc.html">..</a> <code class="code">end</code></pre><hr width="100%">
+<pre><span id="MODULEMisc"><span class="keyword">module</span> Misc</span>: <code class="code">sig</code> <a href="Misc.html">..</a> <code class="code">end</code></pre><hr width="100%">
 
 <pre><span id="VALload_file"><span class="keyword">val</span> load_file</span> : <code class="type">string -> string</code></pre></body></html>
\ No newline at end of file
index 1dafc576bafe604542b64bfd652331e9a289cb71..6b235d13f7a385a87c65a99a63df2118c1c8c4f7 100644 (file)
@@ -28,7 +28,7 @@
 </div>
 <h1>Module <a href="type_Rope.html">Rope</a></h1>
 
-<pre><span class="keyword">module</span> Rope: <code class="code">sig</code> <a href="Rope.html">..</a> <code class="code">end</code></pre><hr width="100%">
+<pre><span id="MODULERope"><span class="keyword">module</span> Rope</span>: <code class="code">sig</code> <a href="Rope.html">..</a> <code class="code">end</code></pre><hr width="100%">
 
 <pre><span id="EXCEPTIONOut_of_bounds"><span class="keyword">exception</span> Out_of_bounds</span> <span class="keyword">of</span> <code class="type">string</code></pre>
 
 <pre><span id="VALis_leaf"><span class="keyword">val</span> is_leaf</span> : <code class="type"><a href="Rope.html#TYPEt">t</a> -> bool</code></pre>
 <pre><span id="VALlimit_index"><span class="keyword">val</span> limit_index</span> : <code class="type"><a href="Rope.html#TYPEt">t</a> -> int -> int</code></pre>
 <pre><span id="VALlast"><span class="keyword">val</span> last</span> : <code class="type"><a href="Rope.html#TYPEt">t</a> -> int</code></pre>
-<pre><span id="VALcheck_index"><span class="keyword">val</span> check_index</span> : <code class="type"><a href="Rope.html#TYPEt">t</a> -> int -> unit</code></pre>
-<pre><span id="VALgetb"><span class="keyword">val</span> getb</span> : <code class="type"><a href="Rope.html#TYPEt">t</a> -> int -> char</code></pre>
 <pre><span id="VALgetc"><span class="keyword">val</span> getc</span> : <code class="type"><a href="Rope.html#TYPEt">t</a> -> int -> int</code></pre>
 <pre><span id="VALiteri"><span class="keyword">val</span> iteri</span> : <code class="type">(int -> int -> bool) -> <a href="Rope.html#TYPEt">t</a> -> int -> unit</code></pre>
 <pre><span id="VALgets"><span class="keyword">val</span> gets</span> : <code class="type"><a href="Rope.html#TYPEt">t</a> -> int -> int -> string</code></pre>
+<pre><span id="VALto_string"><span class="keyword">val</span> to_string</span> : <code class="type"><a href="Rope.html#TYPEt">t</a> -> string</code></pre>
 <pre><span id="VALflatten"><span class="keyword">val</span> flatten</span> : <code class="type"><a href="Rope.html#TYPEt">t</a> -> <a href="Rope.html#TYPEt">t</a></code></pre>
 <pre><span id="VALjoin"><span class="keyword">val</span> join</span> : <code class="type"><a href="Rope.html#TYPEt">t</a> -> <a href="Rope.html#TYPEt">t</a> -> <a href="Rope.html#TYPEt">t</a></code></pre>
 <pre><span id="VALjoin_special"><span class="keyword">val</span> join_special</span> : <code class="type"><a href="Rope.html#TYPEt">t</a> -> <a href="Rope.html#TYPEt">t</a> -> <a href="Rope.html#TYPEt">t</a> -> <a href="Rope.html#TYPEt">t</a></code></pre>
index be5b11d78ff425523cf6d0de1cf9a5f601bf6425..36b4e014f4a90dcb03e3d913ef8440a85040bcc4 100644 (file)
@@ -28,7 +28,7 @@
 </div>
 <h1>Module <a href="type_Scrollmap.html">Scrollmap</a></h1>
 
-<pre><span class="keyword">module</span> Scrollmap: <code class="code">sig</code> <a href="Scrollmap.html">..</a> <code class="code">end</code></pre><hr width="100%">
+<pre><span id="MODULEScrollmap"><span class="keyword">module</span> Scrollmap</span>: <code class="code">sig</code> <a href="Scrollmap.html">..</a> <code class="code">end</code></pre><hr width="100%">
 
 <pre><code><span id="TYPEt"><span class="keyword">type</span> <code class="type"></code>t</span> = {</code></pre><table class="typetable">
 <tr>
index 2d6e1faabe18970e3fd0f72483616edc9a5716f0..2ad94d52621b36ea7808fcf2b7cda1a307118f46 100644 (file)
@@ -26,7 +26,7 @@
 &nbsp;</div>
 <h1>Module <a href="type_View.html">View</a></h1>
 
-<pre><span class="keyword">module</span> View: <code class="code">sig</code> <a href="View.html">..</a> <code class="code">end</code></pre><hr width="100%">
+<pre><span id="MODULEView"><span class="keyword">module</span> View</span>: <code class="code">sig</code> <a href="View.html">..</a> <code class="code">end</code></pre><hr width="100%">
 
 <pre><code><span id="TYPEt"><span class="keyword">type</span> <code class="type"></code>t</span> = {</code></pre><table class="typetable">
 <tr>
index e94cdda8ab0d67d8791e1850ede5bb72df329b02..a603a14dec7f797c6152bf36dd9bf66a8c3b3a99 100644 (file)
@@ -26,5 +26,5 @@
 &nbsp;</div>
 <h1>Module <a href="type_X11.GlyphMap.html">X11.GlyphMap</a></h1>
 
-<pre><span class="keyword">module</span> GlyphMap: <code class="type">Map.Make</code><code class="code">(</code><code class="type"><a href="X11.Rune.html">Rune</a></code><code class="code">)</code></pre><hr width="100%">
+<pre><span id="MODULEGlyphMap"><span class="keyword">module</span> GlyphMap</span>: <code class="type">Map.Make</code><code class="code">(</code><code class="type"><a href="X11.Rune.html">Rune</a></code><code class="code">)</code></pre><hr width="100%">
 </body></html>
\ No newline at end of file
index 2a9f928497433a573ab3afa24aaea8b8adbe326f..38c5d18a5376bcbaba09c149bfe557f3e46984f4 100644 (file)
@@ -26,7 +26,7 @@
 </div>
 <h1>Module <a href="type_X11.Rune.html">X11.Rune</a></h1>
 
-<pre><span class="keyword">module</span> Rune: <code class="code">sig</code> <a href="X11.Rune.html">..</a> <code class="code">end</code></pre><hr width="100%">
+<pre><span id="MODULERune"><span class="keyword">module</span> Rune</span>: <code class="code">sig</code> <a href="X11.Rune.html">..</a> <code class="code">end</code></pre><hr width="100%">
 
 <pre><span id="TYPEt"><span class="keyword">type</span> <code class="type"></code>t</span> = <code class="type">int</code> </pre>
 
index 62712732426f7c47a4def2970393d27445a27ae6..dc39ef4896d623a95ca2148c30165a366d61dc1b 100644 (file)
@@ -28,7 +28,7 @@
 </div>
 <h1>Module <a href="type_X11.html">X11</a></h1>
 
-<pre><span class="keyword">module</span> X11: <code class="code">sig</code> <a href="X11.html">..</a> <code class="code">end</code></pre><hr width="100%">
+<pre><span id="MODULEX11"><span class="keyword">module</span> X11</span>: <code class="code">sig</code> <a href="X11.html">..</a> <code class="code">end</code></pre><hr width="100%">
 
 <pre><span id="TYPExatom"><span class="keyword">type</span> <code class="type"></code>xatom</span> </pre>
 
 
 
 
-<pre><span class="keyword">module</span> <a href="X11.Rune.html">Rune</a>: <code class="code">sig</code> <a href="X11.Rune.html">..</a> <code class="code">end</code></pre>
-<pre><span class="keyword">module</span> <a href="X11.GlyphMap.html">GlyphMap</a>: <code class="type">Map.Make</code><code class="code">(</code><code class="type"><a href="X11.Rune.html">Rune</a></code><code class="code">)</code></pre>
+<pre><span id="MODULERune"><span class="keyword">module</span> <a href="X11.Rune.html">Rune</a></span>: <code class="code">sig</code> <a href="X11.Rune.html">..</a> <code class="code">end</code></pre>
+<pre><span id="MODULEGlyphMap"><span class="keyword">module</span> <a href="X11.GlyphMap.html">GlyphMap</a></span>: <code class="type">Map.Make</code><code class="code">(</code><code class="type"><a href="X11.Rune.html">Rune</a></code><code class="code">)</code></pre>
 <pre><span id="VALconnect"><span class="keyword">val</span> connect</span> : <code class="type">unit -> unit</code></pre>
 <pre><span id="VALdisconnect"><span class="keyword">val</span> disconnect</span> : <code class="type">unit -> unit</code></pre>
 <pre><span id="VALmake_window"><span class="keyword">val</span> make_window</span> : <code class="type">int -> int -> <a href="X11.html#TYPExwin">xwin</a></code></pre>
index d21b245527f9de922ebe21595f00cfa14dbe8667..6cfc26cf7de6baa7c72c6f21a0677e363068294a 100644 (file)
 <link title="View" rel="Chapter" href="View.html"><title></title>
 </head>
 <body>
-<h1></h1>
+<div class = "index-list">
 <ul class="indexlist">
 <li><a href="index_types.html">Index of types</a></li>
 <li><a href="index_exceptions.html">Index of exceptions</a></li>
 <li><a href="index_values.html">Index of values</a></li>
 <li><a href="index_modules.html">Index of modules</a></li>
 </ul>
-<br/><br>
-<table class="indextable">
+</div>
+
+<table class="indextable module-list">
 <tr><td class="module"><a href="Misc.html">Misc</a></td><td></td></tr>
 <tr><td class="module"><a href="X11.html">X11</a></td><td></td></tr>
 <tr><td class="module"><a href="Cfg.html">Cfg</a></td><td></td></tr>
index b674928e245a7328ac5053b29c0960967eda9c07..63563392b5afe0d186dbd0ad395d375029bc806d 100644 (file)
 &nbsp;</div>
 <h1>Index of exceptions</h1>
 <table>
-<tr><td align="left"><br>B</td></tr>
+<tr><td align="left"><div>B</div></td></tr>
 <tr><td><a href="Rope.html#EXCEPTIONBad_rotation">Bad_rotation</a> [<a href="Rope.html">Rope</a>]</td>
 <td></td></tr>
-<tr><td align="left"><br>O</td></tr>
+<tr><td align="left"><div>O</div></td></tr>
 <tr><td><a href="Rope.html#EXCEPTIONOut_of_bounds">Out_of_bounds</a> [<a href="Rope.html">Rope</a>]</td>
 <td></td></tr>
 </table>
index 1407eb69c71d51268e623fc567f1c9dd07684dc1..d23f065697cfafdf39ded55d4ada1246c468171f 100644 (file)
 &nbsp;</div>
 <h1>Index of modules</h1>
 <table>
-<tr><td align="left"><br>B</td></tr>
+<tr><td align="left"><div>B</div></td></tr>
 <tr><td><a href="Buf.html">Buf</a> </td>
 <td></td></tr>
-<tr><td align="left"><br>C</td></tr>
+<tr><td align="left"><div>C</div></td></tr>
 <tr><td><a href="Cfg.html">Cfg</a> </td>
 <td></td></tr>
 <tr><td><a href="Cfg.Color.html">Color</a> [<a href="Cfg.html">Cfg</a>]</td>
 <td></td></tr>
 <tr><td><a href="Buf.Cursor.html">Cursor</a> [<a href="Buf.html">Buf</a>]</td>
 <td></td></tr>
-<tr><td align="left"><br>D</td></tr>
+<tr><td align="left"><div>D</div></td></tr>
 <tr><td><a href="Draw.html">Draw</a> </td>
 <td></td></tr>
-<tr><td align="left"><br>G</td></tr>
+<tr><td align="left"><div>G</div></td></tr>
 <tr><td><a href="X11.GlyphMap.html">GlyphMap</a> [<a href="X11.html">X11</a>]</td>
 <td></td></tr>
-<tr><td align="left"><br>M</td></tr>
+<tr><td align="left"><div>M</div></td></tr>
 <tr><td><a href="Misc.html">Misc</a> </td>
 <td></td></tr>
-<tr><td align="left"><br>R</td></tr>
+<tr><td align="left"><div>R</div></td></tr>
 <tr><td><a href="Rope.html">Rope</a> </td>
 <td></td></tr>
 <tr><td><a href="X11.Rune.html">Rune</a> [<a href="X11.html">X11</a>]</td>
 <td></td></tr>
-<tr><td align="left"><br>S</td></tr>
+<tr><td align="left"><div>S</div></td></tr>
 <tr><td><a href="Scrollmap.html">Scrollmap</a> </td>
 <td></td></tr>
 <tr><td><a href="Cfg.Color.Syntax.html">Syntax</a> [<a href="Cfg.Color.html">Cfg.Color</a>]</td>
 <td></td></tr>
-<tr><td align="left"><br>V</td></tr>
+<tr><td align="left"><div>V</div></td></tr>
 <tr><td><a href="View.html">View</a> </td>
 <td></td></tr>
-<tr><td align="left"><br>X</td></tr>
+<tr><td align="left"><div>X</div></td></tr>
 <tr><td><a href="X11.html">X11</a> </td>
 <td></td></tr>
 </table>
index c9e1ebc5d23aa9cf27bcf8abf8d8857167349497..8e000521f52655fa8f932889c88943f976da4205 100644 (file)
 &nbsp;</div>
 <h1>Index of types</h1>
 <table>
-<tr><td align="left"><br>B</td></tr>
+<tr><td align="left"><div>B</div></td></tr>
 <tr><td><a href="Buf.html#TYPEbuf">buf</a> [<a href="Buf.html">Buf</a>]</td>
 <td></td></tr>
-<tr><td align="left"><br>C</td></tr>
+<tr><td align="left"><div>C</div></td></tr>
 <tr><td><a href="Buf.Cursor.html#TYPEcsr">csr</a> [<a href="Buf.Cursor.html">Buf.Cursor</a>]</td>
 <td></td></tr>
-<tr><td align="left"><br>D</td></tr>
+<tr><td align="left"><div>D</div></td></tr>
 <tr><td><a href="Buf.html#TYPEdest">dest</a> [<a href="Buf.html">Buf</a>]</td>
 <td></td></tr>
-<tr><td align="left"><br>F</td></tr>
+<tr><td align="left"><div>F</div></td></tr>
 <tr><td><a href="X11.html#TYPEfont">font</a> [<a href="X11.html">X11</a>]</td>
 <td></td></tr>
-<tr><td align="left"><br>G</td></tr>
+<tr><td align="left"><div>G</div></td></tr>
 <tr><td><a href="X11.html#TYPEglyph">glyph</a> [<a href="X11.html">X11</a>]</td>
 <td></td></tr>
-<tr><td align="left"><br>R</td></tr>
+<tr><td align="left"><div>R</div></td></tr>
 <tr><td><a href="Rope.html#TYPErope">rope</a> [<a href="Rope.html">Rope</a>]</td>
 <td></td></tr>
 <tr><td><a href="Rope.html#TYPErune">rune</a> [<a href="Rope.html">Rope</a>]</td>
 <td></td></tr>
-<tr><td align="left"><br>T</td></tr>
+<tr><td align="left"><div>T</div></td></tr>
 <tr><td><a href="View.html#TYPEt">t</a> [<a href="View.html">View</a>]</td>
 <td></td></tr>
 <tr><td><a href="Scrollmap.html#TYPEt">t</a> [<a href="Scrollmap.html">Scrollmap</a>]</td>
@@ -57,7 +57,7 @@
 <td></td></tr>
 <tr><td><a href="X11.Rune.html#TYPEt">t</a> [<a href="X11.Rune.html">X11.Rune</a>]</td>
 <td></td></tr>
-<tr><td align="left"><br>X</td></tr>
+<tr><td align="left"><div>X</div></td></tr>
 <tr><td><a href="X11.html#TYPExatom">xatom</a> [<a href="X11.html">X11</a>]</td>
 <td></td></tr>
 <tr><td><a href="X11.html#TYPExcfgvar">xcfgvar</a> [<a href="X11.html">X11</a>]</td>
index 7e34b420261c204aeb36fc698cc3f9266480ccb8..9bd4278fc3eda1e8142b8490e743781e9d4906a1 100644 (file)
@@ -22,7 +22,7 @@
 &nbsp;</div>
 <h1>Index of values</h1>
 <table>
-<tr><td align="left"><br>B</td></tr>
+<tr><td align="left"><div>B</div></td></tr>
 <tr><td><a href="Buf.Cursor.html#VALbol">bol</a> [<a href="Buf.Cursor.html">Buf.Cursor</a>]</td>
 <td></td></tr>
 <tr><td><a href="Buf.html#VALbol">bol</a> [<a href="Buf.html">Buf</a>]</td>
 <td></td></tr>
 <tr><td><a href="Draw.html#VALbuffer">buffer</a> [<a href="Draw.html">Draw</a>]</td>
 <td></td></tr>
-<tr><td align="left"><br>C</td></tr>
+<tr><td align="left"><div>C</div></td></tr>
 <tr><td><a href="X11.html#VALcache_update">cache_update</a> [<a href="X11.html">X11</a>]</td>
 <td></td></tr>
 <tr><td><a href="Cfg.Color.Syntax.html#VALchar">char</a> [<a href="Cfg.Color.Syntax.html">Cfg.Color.Syntax</a>]</td>
 <td></td></tr>
-<tr><td><a href="Rope.html#VALcheck_index">check_index</a> [<a href="Rope.html">Rope</a>]</td>
-<td></td></tr>
 <tr><td><a href="Draw.Cursor.html#VALclone">clone</a> [<a href="Draw.Cursor.html">Draw.Cursor</a>]</td>
 <td></td></tr>
 <tr><td><a href="Buf.Cursor.html#VALclone">clone</a> [<a href="Buf.Cursor.html">Buf.Cursor</a>]</td>
@@ -60,7 +58,7 @@
 <td></td></tr>
 <tr><td><a href="Cfg.html#VALcopy_indent">copy_indent</a> [<a href="Cfg.html">Cfg</a>]</td>
 <td></td></tr>
-<tr><td align="left"><br>D</td></tr>
+<tr><td align="left"><div>D</div></td></tr>
 <tr><td><a href="Draw.html#VALdark_bkg">dark_bkg</a> [<a href="Draw.html">Draw</a>]</td>
 <td></td></tr>
 <tr><td><a href="Cfg.html#VALdbl_click_time">dbl_click_time</a> [<a href="Cfg.html">Cfg</a>]</td>
@@ -87,7 +85,7 @@
 <td></td></tr>
 <tr><td><a href="Draw.Cursor.html#VALdraw_tab">draw_tab</a> [<a href="Draw.Cursor.html">Draw.Cursor</a>]</td>
 <td></td></tr>
-<tr><td align="left"><br>E</td></tr>
+<tr><td align="left"><div>E</div></td></tr>
 <tr><td><a href="Draw.html#VALedit">edit</a> [<a href="Draw.html">Draw</a>]</td>
 <td></td></tr>
 <tr><td><a href="Cfg.Color.html#VALedit_csr">edit_csr</a> [<a href="Cfg.Color.html">Cfg.Color</a>]</td>
 <td></td></tr>
 <tr><td><a href="Cfg.html#VALexpand_tabs">expand_tabs</a> [<a href="Cfg.html">Cfg</a>]</td>
 <td></td></tr>
-<tr><td align="left"><br>F</td></tr>
+<tr><td align="left"><div>F</div></td></tr>
 <tr><td><a href="Scrollmap.html#VALfind_line">find_line</a> [<a href="Scrollmap.html">Scrollmap</a>]</td>
 <td></td></tr>
 <tr><td><a href="Scrollmap.html#VALfirst">first</a> [<a href="Scrollmap.html">Scrollmap</a>]</td>
 <td></td></tr>
 <tr><td><a href="Rope.html#VALfrom_string">from_string</a> [<a href="Rope.html">Rope</a>]</td>
 <td></td></tr>
-<tr><td align="left"><br>G</td></tr>
+<tr><td align="left"><div>G</div></td></tr>
 <tr><td><a href="X11.html#VALget_glyph">get_glyph</a> [<a href="X11.html">X11</a>]</td>
 <td></td></tr>
-<tr><td><a href="Rope.html#VALgetb">getb</a> [<a href="Rope.html">Rope</a>]</td>
-<td></td></tr>
 <tr><td><a href="Buf.Cursor.html#VALgetc">getc</a> [<a href="Buf.Cursor.html">Buf.Cursor</a>]</td>
 <td></td></tr>
 <tr><td><a href="Rope.html#VALgetc">getc</a> [<a href="Rope.html">Rope</a>]</td>
 <td></td></tr>
 <tr><td><a href="Cfg.Color.html#VALgutter_sel">gutter_sel</a> [<a href="Cfg.Color.html">Cfg.Color</a>]</td>
 <td></td></tr>
-<tr><td align="left"><br>H</td></tr>
+<tr><td align="left"><div>H</div></td></tr>
 <tr><td><a href="Draw.Cursor.html#VALhas_next_line">has_next_line</a> [<a href="Draw.Cursor.html">Draw.Cursor</a>]</td>
 <td></td></tr>
 <tr><td><a href="Rope.html#VALheight">height</a> [<a href="Rope.html">Rope</a>]</td>
 <td></td></tr>
 <tr><td><a href="Draw.html#VALhrule">hrule</a> [<a href="Draw.html">Draw</a>]</td>
 <td></td></tr>
-<tr><td align="left"><br>I</td></tr>
+<tr><td align="left"><div>I</div></td></tr>
 <tr><td><a href="X11.html#VALintern">intern</a> [<a href="X11.html">X11</a>]</td>
 <td></td></tr>
 <tr><td><a href="Cfg.html#VALintvar">intvar</a> [<a href="Cfg.html">Cfg</a>]</td>
 <td></td></tr>
 <tr><td><a href="Rope.html#VALiteri">iteri</a> [<a href="Rope.html">Rope</a>]</td>
 <td></td></tr>
-<tr><td align="left"><br>J</td></tr>
+<tr><td align="left"><div>J</div></td></tr>
 <tr><td><a href="Rope.html#VALjoin">join</a> [<a href="Rope.html">Rope</a>]</td>
 <td></td></tr>
 <tr><td><a href="Rope.html#VALjoin_special">join_special</a> [<a href="Rope.html">Rope</a>]</td>
 <td></td></tr>
-<tr><td align="left"><br>K</td></tr>
+<tr><td align="left"><div>K</div></td></tr>
 <tr><td><a href="Cfg.Color.Syntax.html#VALkeyword">keyword</a> [<a href="Cfg.Color.Syntax.html">Cfg.Color.Syntax</a>]</td>
 <td></td></tr>
-<tr><td align="left"><br>L</td></tr>
+<tr><td align="left"><div>L</div></td></tr>
 <tr><td><a href="Rope.html#VALlast">last</a> [<a href="Rope.html">Rope</a>]</td>
 <td></td></tr>
 <tr><td><a href="Buf.html#VALlength">length</a> [<a href="Buf.html">Buf</a>]</td>
 <td></td></tr>
 <tr><td><a href="Misc.html#VALload_file">load_file</a> [<a href="Misc.html">Misc</a>]</td>
 <td></td></tr>
-<tr><td align="left"><br>M</td></tr>
+<tr><td align="left"><div>M</div></td></tr>
 <tr><td><a href="View.html#VALmake">make</a> [<a href="View.html">View</a>]</td>
 <td></td></tr>
 <tr><td><a href="Scrollmap.html#VALmake">make</a> [<a href="Scrollmap.html">Scrollmap</a>]</td>
 <td></td></tr>
 <tr><td><a href="Draw.Cursor.html#VALmove_x">move_x</a> [<a href="Draw.Cursor.html">Draw.Cursor</a>]</td>
 <td></td></tr>
-<tr><td align="left"><br>N</td></tr>
+<tr><td align="left"><div>N</div></td></tr>
 <tr><td><a href="Draw.Cursor.html#VALnext_glyph">next_glyph</a> [<a href="Draw.Cursor.html">Draw.Cursor</a>]</td>
 <td></td></tr>
 <tr><td><a href="Draw.Cursor.html#VALnext_line">next_line</a> [<a href="Draw.Cursor.html">Draw.Cursor</a>]</td>
 <td></td></tr>
 <tr><td><a href="Cfg.Color.Syntax.html#VALnumber">number</a> [<a href="Cfg.Color.Syntax.html">Cfg.Color.Syntax</a>]</td>
 <td></td></tr>
-<tr><td align="left"><br>O</td></tr>
+<tr><td align="left"><div>O</div></td></tr>
 <tr><td><a href="Buf.Cursor.html#VALoffset">offset</a> [<a href="Buf.Cursor.html">Buf.Cursor</a>]</td>
 <td></td></tr>
 <tr><td><a href="Cfg.Color.Syntax.html#VALoperator">operator</a> [<a href="Cfg.Color.Syntax.html">Cfg.Color.Syntax</a>]</td>
 <td></td></tr>
-<tr><td align="left"><br>P</td></tr>
+<tr><td align="left"><div>P</div></td></tr>
 <tr><td><a href="Cfg.Color.html#VALpalette">palette</a> [<a href="Cfg.Color.html">Cfg.Color</a>]</td>
 <td></td></tr>
 <tr><td><a href="View.html#VALpath">path</a> [<a href="View.html">View</a>]</td>
 <td></td></tr>
 <tr><td><a href="Rope.html#VALputs">puts</a> [<a href="Rope.html">Rope</a>]</td>
 <td></td></tr>
-<tr><td align="left"><br>R</td></tr>
+<tr><td align="left"><div>R</div></td></tr>
 <tr><td><a href="Draw.html#VALrectangle">rectangle</a> [<a href="Draw.html">Draw</a>]</td>
 <td></td></tr>
 <tr><td><a href="View.html#VALresize">resize</a> [<a href="View.html">View</a>]</td>
 <td></td></tr>
 <tr><td><a href="Cfg.html#VALruler_column">ruler_column</a> [<a href="Cfg.html">Cfg</a>]</td>
 <td></td></tr>
-<tr><td align="left"><br>S</td></tr>
+<tr><td align="left"><div>S</div></td></tr>
 <tr><td><a href="Draw.html#VALscroll">scroll</a> [<a href="Draw.html">Draw</a>]</td>
 <td></td></tr>
 <tr><td><a href="View.html#VALscroll_dn">scroll_dn</a> [<a href="View.html">View</a>]</td>
 <td></td></tr>
 <tr><td><a href="Cfg.html#VALsyntax_enabled">syntax_enabled</a> [<a href="Cfg.html">Cfg</a>]</td>
 <td></td></tr>
-<tr><td align="left"><br>T</td></tr>
+<tr><td align="left"><div>T</div></td></tr>
 <tr><td><a href="Cfg.html#VALtab_width">tab_width</a> [<a href="Cfg.html">Cfg</a>]</td>
 <td></td></tr>
 <tr><td><a href="Draw.html#VALtabglyph">tabglyph</a> [<a href="Draw.html">Draw</a>]</td>
 <td></td></tr>
 <tr><td><a href="Rope.html#VALto_eol">to_eol</a> [<a href="Rope.html">Rope</a>]</td>
 <td></td></tr>
+<tr><td><a href="Rope.html#VALto_string">to_string</a> [<a href="Rope.html">Rope</a>]</td>
+<td></td></tr>
 <tr><td><a href="Cfg.html#VALtrim_on_save">trim_on_save</a> [<a href="Cfg.html">Cfg</a>]</td>
 <td></td></tr>
 <tr><td><a href="Cfg.Color.Syntax.html#VALtypedef">typedef</a> [<a href="Cfg.Color.Syntax.html">Cfg.Color.Syntax</a>]</td>
 <td></td></tr>
-<tr><td align="left"><br>V</td></tr>
+<tr><td align="left"><div>V</div></td></tr>
 <tr><td><a href="X11.html#VALvar_get">var_get</a> [<a href="X11.html">X11</a>]</td>
 <td></td></tr>
 <tr><td><a href="Cfg.Color.Syntax.html#VALvariable">variable</a> [<a href="Cfg.Color.Syntax.html">Cfg.Color.Syntax</a>]</td>
 <td></td></tr>
 <tr><td><a href="Draw.html#VALvrule">vrule</a> [<a href="Draw.html">Draw</a>]</td>
 <td></td></tr>
-<tr><td align="left"><br>W</td></tr>
+<tr><td align="left"><div>W</div></td></tr>
 <tr><td><a href="Cfg.html#VALwinheight">winheight</a> [<a href="Cfg.html">Cfg</a>]</td>
 <td></td></tr>
 <tr><td><a href="Cfg.html#VALwinwidth">winwidth</a> [<a href="Cfg.html">Cfg</a>]</td>
index 80ee296183f215c1d16b2f68db282fda7586de72..b388f4954ba8bb53bca774dfea38140e571c9299 100644 (file)
@@ -24,6 +24,7 @@
 &nbsp;&nbsp;<span class="keyword">val</span>&nbsp;is_empty&nbsp;:&nbsp;<span class="keywordsign">'</span>a&nbsp;t&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;bool<br>
 &nbsp;&nbsp;<span class="keyword">val</span>&nbsp;mem&nbsp;:&nbsp;key&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="keywordsign">'</span>a&nbsp;t&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;bool<br>
 &nbsp;&nbsp;<span class="keyword">val</span>&nbsp;add&nbsp;:&nbsp;key&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="keywordsign">'</span>a&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="keywordsign">'</span>a&nbsp;t&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="keywordsign">'</span>a&nbsp;t<br>
+&nbsp;&nbsp;<span class="keyword">val</span>&nbsp;update&nbsp;:&nbsp;key&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;(<span class="keywordsign">'</span>a&nbsp;option&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="keywordsign">'</span>a&nbsp;option)&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="keywordsign">'</span>a&nbsp;t&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="keywordsign">'</span>a&nbsp;t<br>
 &nbsp;&nbsp;<span class="keyword">val</span>&nbsp;singleton&nbsp;:&nbsp;key&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="keywordsign">'</span>a&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="keywordsign">'</span>a&nbsp;t<br>
 &nbsp;&nbsp;<span class="keyword">val</span>&nbsp;remove&nbsp;:&nbsp;key&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="keywordsign">'</span>a&nbsp;t&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="keywordsign">'</span>a&nbsp;t<br>
 &nbsp;&nbsp;<span class="keyword">val</span>&nbsp;merge&nbsp;:<br>
index 873c114ab1d69c33a6a9040a8f5faf35f6430224..86ff9efc956c5e69fc366a0784af1364ab424a7c 100644 (file)
@@ -33,36 +33,10 @@ let limit_index rope i =
 let last rope =
   limit_index rope ((length rope) - 1)
 
-let check_index rope i =
-  if i < 0 || i >= (length rope) then begin
-    raise (Out_of_bounds "Rope.check_index")
-  end
-
-let rec getb rope i =
-  check_index rope i;
-  match rope with
-  | Leaf (s,off,_) ->
-      s.[off + i]
-  | Node (l,r,h,len) ->
-      let left_len = (length l) in
-      if i < left_len then
-        getb l i
-      else
-        getb r (i - left_len)
-
 let rec getc rope i =
-  check_index rope i;
   match rope with
-  | Leaf (s,off,_) -> (Char.code s.[off + i])
-(*
-      let c = (Char.code s.[off + i]) in
-      let len = (length rope) in
-      let next = (i + 1) in
-      if (c == 0x0D && next < len && (getc rope next) == 0x0A) then
-        0x0A
-      else
-        c
-*)
+  | Leaf (s,off,_) ->
+      Char.code s.[off + i]
   | Node (l,r,h,len) ->
       let left_len = (length l) in
       if i < left_len then
@@ -72,7 +46,7 @@ let rec getc rope i =
 
 (* inefficient form of iteri *)
 let rec iteri fn rope pos =
-  if pos < (length rope) && (fn pos (Char.code (getb rope pos))) then
+  if pos < (length rope) && (fn pos (getc rope pos)) then
     iteri fn rope (pos + 1)
 
 (* More efficient form of iteri?
@@ -104,6 +78,9 @@ let gets rope i j =
     rope i;
   Bytes.unsafe_to_string buf
 
+let to_string rope =
+  gets rope 0 (length rope)
+
 (* Rebalancing Algorithm from the original paper on ropes:
 
 * Height of leaf is 0
@@ -176,8 +153,6 @@ and join_special left right node =
   | _ -> node
 
 let rec split rope i =
-  if i < 0 || i > (length rope) then
-    raise (Out_of_bounds "Rope.split");
   match rope with
   | Leaf (s,off,len) ->
       (Leaf (s, off,  i), Leaf (s, (off + i), len - (i)))
index fd9e5456b8d7e5db1492086641b32244bf7835b4..17c79486974c86eddf5edec5d391558170b99187 100644 (file)
@@ -9,6 +9,7 @@ type rune = int
 
 val empty : rope
 val from_string : string -> rope
+val to_string : rope -> string
 
 val length : rope -> int
 val height : rope -> int
@@ -22,7 +23,6 @@ val del : rope -> int -> int -> rope
 
 val iteri : (int -> rune -> bool) -> rope -> int -> unit
 
-val getb : rope -> int -> char
 val getc : rope -> int -> rune
 val putc : rope -> int -> rune -> rope
 val gets : rope -> int -> int -> string
index 64115bd0fc3eb116290d91f3c3fb9aa4c110df6a..5cec04574b369d8dd465859f056597937ca075a7 100644 (file)
@@ -1,8 +1,16 @@
 open Test
 open Rope
 
-let  () =
-  (* length() tests *)
+let () = (* empty tests *)
+  test "empty : should be an empty rope" (fun () ->
+    let rope = Rope.empty in
+    assert( length rope == 0 );
+    assert( height rope == 0 );
+    assert( to_string rope = "" )
+  );
+  ()
+
+let () = (* length() tests *)
   test "length : 0 for empty string" (fun () ->
     let rope = Leaf("", 0, 0) in
     assert( length rope == 0 )
@@ -15,8 +23,28 @@ let  () =
     let rope = (join (Leaf("a", 0, 1)) (Leaf("a", 0, 1))) in
     assert( length rope == 2 )
   );
+  ()
+
+let () = (* last() tests *)
+  test "last() : should return 0" (fun () ->
+    let rope = from_string "" in
+    assert( last rope == 0 );
+  );
+  test "last() : should return 0" (fun () ->
+    let rope = from_string "a" in
+    assert( last rope == 0 );
+  );
+  test "last() : should return 1" (fun () ->
+    let rope = from_string "ab" in
+    assert( last rope == 1 );
+  );
+  test "last() : should return 2" (fun () ->
+    let rope = from_string "abc" in
+    assert( last rope == 2 );
+  );
+  ()
 
-  (* flatten() tests *)
+let () = (* flatten() tests *)
   test "flatten : flatten a tree to a leaf" (fun () ->
     let tree = Node (Leaf("a", 0, 1), Leaf("b", 0, 1), 2, 2) in
     let leaf = (flatten tree) in
@@ -24,8 +52,9 @@ let  () =
     | Leaf ("ab",0,2) -> true
     | _ -> false)
   );
+  ()
 
-  (* join() tests *)
+let () = (* join() tests *)
   test "join : join two leaves into rope" (fun () ->
     let left  = Leaf("a", 0, 1) in
     let right =  Leaf("b", 0, 1) in
@@ -50,17 +79,36 @@ let  () =
     | Leaf ("abc",0,3) -> true
     | _ -> false)
   );
+  ()
 
-  (* getc() tests *)
+let () = (* split() tests *)
+  test "split : split string into two parts" (fun () ->
+    let left, right = split (from_string "ab") 1 in
+    assert (to_string left = "a");
+    assert (to_string right = "b")
+  );
+  test "split : split string into empty left and full right" (fun () ->
+    let left, right = split (from_string "ab") 0 in
+    assert (to_string left = "");
+    assert (to_string right = "ab")
+  );
+  test "split : split string into empty right and full left" (fun () ->
+    let left, right = split (from_string "ab") 2 in
+    assert (to_string left = "ab");
+    assert (to_string right = "")
+  );
+  ()
+
+let () = (* getc() tests *)
   test "getc : raise Out_of_bounds on negative index" (fun () ->
     let rope = Leaf("a", 0, 1) in
     try let _ = getc rope (-1) in assert false
-    with Out_of_bounds _ -> assert true
+    with Invalid_argument _ -> assert true
   );
   test "getc : raise Out_of_bounds on out of bounds index" (fun () ->
     let rope = Leaf("a", 0, 1) in
     try let _ = getc rope (2) in assert false
-    with Out_of_bounds _ -> assert true
+    with Invalid_argument _ -> assert true
   );
   test "getc : return index 0 of leaf" (fun () ->
     let rope = Leaf("abc", 0, 3) in
@@ -82,11 +130,6 @@ let  () =
     let rope = Node((Leaf("a", 0, 1)), (Leaf("b", 0, 1)), 0, 2) in
     assert( (getc rope (1)) == Char.code 'b' );
   );
-(*  test "getc : return \\n for \\r\\n" (fun () ->
-    let rope = from_string "\r\n" in
-    assert( (getc rope (0)) == Char.code '\n' );
-  );
-*)
   test "getc : return \\r for \\r at end of string" (fun () ->
     let rope = from_string "\r" in
     assert( (getc rope (0)) == Char.code '\r' );
@@ -95,8 +138,9 @@ let  () =
     let rope = from_string "\ra" in
     assert( (getc rope (0)) == Char.code '\r' );
   );
+  ()
 
-  (* puts() tests *)
+let () = (* puts() tests *)
   test "puts : insert at index 0" (fun () ->
     let rope = Leaf("bc", 0, 2) in
     let rope = (puts rope "a" 0) in
@@ -124,8 +168,9 @@ let  () =
     assert( (getc rope (1)) == Char.code 'b' );
     assert( (getc rope (2)) == Char.code 'c' );
   );
+  ()
 
-  (* nextc() tests *)
+let () = (* nextc() tests *)
   test "nextc : should return pos if at end of buffer" (fun () ->
     let rope = Leaf("abc", 0, 3) in
     assert( 2 == (nextc rope 2) );
@@ -134,8 +179,9 @@ let  () =
     let rope = Leaf("a\na", 0, 3) in
     assert( 2 == (nextc rope 1) );
   );
+  ()
 
-  (* prevc() tests *)
+let () = (* prevc() tests *)
   test "prevc : should return pos if at start of buffer" (fun () ->
     let rope = Leaf("abc", 0, 3) in
     assert( 0 == (prevc rope 0) );
@@ -144,8 +190,9 @@ let  () =
     let rope = Leaf("a\na", 0, 3) in
     assert( 1 == (prevc rope 2) );
   );
+  ()
 
-  (* is_bol() tests *)
+let () = (* is_bol() tests *)
   test "is_bol : should return true if pos is 0" (fun () ->
     let rope = Leaf("abc", 0, 3) in
     assert( is_bol rope 0 );
@@ -162,8 +209,9 @@ let  () =
     let rope = Leaf("\rabc", 0, 3) in
     assert( (is_bol rope 1) == false );
   );
+  ()
 
-  (* is_eol() tests *)
+let () = (* is_eol() tests *)
   test "is_eol : should return true if pos is Rope.last" (fun () ->
     let rope = Leaf("abc", 0, 3) in
     assert( is_eol rope 2 );
@@ -172,18 +220,22 @@ let  () =
     let rope = Leaf("abc\n", 0, 4) in
     assert( is_eol rope 3 );
   );
-(*  test "is_eol : should return true if pos is last char of line with \\r\\n ending" (fun () ->
-    let rope = Leaf("abc\r\n", 0, 5) in
-    assert( is_eol rope 3 );
-  );*)
   test "is_eol : should return false if pos is not last char of line" (fun () ->
     let rope = Leaf("abcd\n", 0, 5) in
     assert( (is_eol rope 2) == false );
   );
+  ()
 
-  (* to_bol() tests *)
+let () = (* to_bol() tests *)
   test "to_bol : should return index of first char on the line" (fun () ->
     let rope = Leaf("\nabc\n", 0, 5) in
     assert( (to_bol rope 2) == 1 );
   );
   ()
+
+let () = (* to_eol() tests *)
+  test "to_bol : should return index of last char on the line" (fun () ->
+    let rope = Leaf("\nabc\n", 0, 5) in
+    assert( (to_eol rope 1) == 4 );
+  );
+  ()