about summary refs log tree commit diff stats
path: root/html/003trace.test.cc.html
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-05-06 00:19:03 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-05-06 00:19:03 -0700
commit672e3e50c6ed6de161e40aa256c3fc0f2b1f7cf9 (patch)
tree5fa3d82e40137b15dec2941a3446e838ce43d3e5 /html/003trace.test.cc.html
parent20d1c9057a559ce8db83bbc2787ca91348bcb16f (diff)
downloadmu-672e3e50c6ed6de161e40aa256c3fc0f2b1f7cf9.tar.gz
1279 - colorized rendering of the source files
Diffstat (limited to 'html/003trace.test.cc.html')
-rw-r--r--html/003trace.test.cc.html204
1 files changed, 204 insertions, 0 deletions
diff --git a/html/003trace.test.cc.html b/html/003trace.test.cc.html
new file mode 100644
index 00000000..d2154cfd
--- /dev/null
+++ b/html/003trace.test.cc.html
@@ -0,0 +1,204 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<title>~/Desktop/s/mu/003trace.test.cc.html</title>
+<meta name="Generator" content="Vim/7.4">
+<meta name="plugin-version" content="vim7.4_v1">
+<meta name="syntax" content="cpp">
+<meta name="settings" content="use_css,pre_wrap,no_foldcolumn,expand_tabs,prevent_copy=">
+<meta name="colorscheme" content="minimal">
+<style type="text/css">
+<!--
+pre { white-space: pre-wrap; font-family: monospace; color: #d0d0d0; background-color: #000000; }
+body { font-family: monospace; color: #d0d0d0; background-color: #000000; }
+* { font-size: 1em; }
+.cSpecial { color: #008000; }
+.Constant { color: #008080; }
+.Delimiter { color: #c000c0; }
+.Comment { color: #8080ff; }
+.Identifier { color: #008080; }
+-->
+</style>
+
+<script type='text/javascript'>
+<!--
+
+-->
+</script>
+</head>
+<body>
+<pre id='vimCodeElement'>
+void test_trace_check_compares<span class="Delimiter">()</span> <span class="Delimiter">{</span>
+  CHECK_TRACE_CONTENTS<span class="Delimiter">(</span><span class="Constant">&quot;test layer&quot;</span><span class="Delimiter">,</span> <span class="Constant">&quot;&quot;</span><span class="Delimiter">);</span>
+  trace<span class="Delimiter">(</span><span class="Constant">&quot;test layer&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;foo&quot;</span><span class="Delimiter">;</span>
+  CHECK_TRACE_CONTENTS<span class="Delimiter">(</span><span class="Constant">&quot;test layer&quot;</span><span class="Delimiter">,</span> <span class="Constant">&quot;foo&quot;</span><span class="Delimiter">);</span>
+<span class="Delimiter">}</span>
+
+void test_trace_check_filters_layers<span class="Delimiter">()</span> <span class="Delimiter">{</span>
+  trace<span class="Delimiter">(</span><span class="Constant">&quot;test layer 1&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;foo&quot;</span><span class="Delimiter">;</span>
+  trace<span class="Delimiter">(</span><span class="Constant">&quot;test layer 2&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;bar&quot;</span><span class="Delimiter">;</span>
+  CHECK_TRACE_CONTENTS<span class="Delimiter">(</span><span class="Constant">&quot;test layer 1&quot;</span><span class="Delimiter">,</span> <span class="Constant">&quot;foo&quot;</span><span class="Delimiter">);</span>
+<span class="Delimiter">}</span>
+
+void test_trace_check_ignores_other_lines<span class="Delimiter">()</span> <span class="Delimiter">{</span>
+  trace<span class="Delimiter">(</span><span class="Constant">&quot;test layer 1&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;foo&quot;</span><span class="Delimiter">;</span>
+  trace<span class="Delimiter">(</span><span class="Constant">&quot;test layer 1&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;bar&quot;</span><span class="Delimiter">;</span>
+  CHECK_TRACE_CONTENTS<span class="Delimiter">(</span><span class="Constant">&quot;test layer 1&quot;</span><span class="Delimiter">,</span> <span class="Constant">&quot;foo&quot;</span><span class="Delimiter">);</span>
+<span class="Delimiter">}</span>
+
+void test_trace_ignores_trailing_whitespace<span class="Delimiter">()</span> <span class="Delimiter">{</span>
+  trace<span class="Delimiter">(</span><span class="Constant">&quot;test layer 1&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;foo</span><span class="cSpecial">\n</span><span class="Constant">&quot;</span><span class="Delimiter">;</span>
+  CHECK_TRACE_CONTENTS<span class="Delimiter">(</span><span class="Constant">&quot;test layer 1&quot;</span><span class="Delimiter">,</span> <span class="Constant">&quot;foo&quot;</span><span class="Delimiter">);</span>
+<span class="Delimiter">}</span>
+
+void test_trace_check_always_finds_empty_lines<span class="Delimiter">()</span> <span class="Delimiter">{</span>
+  CHECK_TRACE_CONTENTS<span class="Delimiter">(</span><span class="Constant">&quot;test layer 1&quot;</span><span class="Delimiter">,</span> <span class="Constant">&quot;&quot;</span><span class="Delimiter">);</span>
+<span class="Delimiter">}</span>
+
+void test_trace_check_treats_empty_layers_as_wildcards<span class="Delimiter">()</span> <span class="Delimiter">{</span>
+  trace<span class="Delimiter">(</span><span class="Constant">&quot;test layer 1&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;foo&quot;</span><span class="Delimiter">;</span>
+  CHECK_TRACE_CONTENTS<span class="Delimiter">(</span><span class="Constant">&quot;&quot;</span><span class="Delimiter">,</span> <span class="Constant">&quot;foo&quot;</span><span class="Delimiter">);</span>
+<span class="Delimiter">}</span>
+
+void test_trace_check_multiple_lines_at_once<span class="Delimiter">()</span> <span class="Delimiter">{</span>
+  trace<span class="Delimiter">(</span><span class="Constant">&quot;test layer 1&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;foo&quot;</span><span class="Delimiter">;</span>
+  trace<span class="Delimiter">(</span><span class="Constant">&quot;test layer 2&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;bar&quot;</span><span class="Delimiter">;</span>
+  CHECK_TRACE_CONTENTS<span class="Delimiter">(</span><span class="Constant">&quot;&quot;</span><span class="Delimiter">,</span> <span class="Constant">&quot;foo^Dbar^D&quot;</span><span class="Delimiter">);</span>
+<span class="Delimiter">}</span>
+
+void test_trace_check_always_finds_empty_lines2<span class="Delimiter">()</span> <span class="Delimiter">{</span>
+  CHECK_TRACE_CONTENTS<span class="Delimiter">(</span><span class="Constant">&quot;test layer 1&quot;</span><span class="Delimiter">,</span> <span class="Constant">&quot;^D^D^D&quot;</span><span class="Delimiter">);</span>
+<span class="Delimiter">}</span>
+
+void test_trace_orders_across_layers<span class="Delimiter">()</span> <span class="Delimiter">{</span>
+  trace<span class="Delimiter">(</span><span class="Constant">&quot;test layer 1&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;foo&quot;</span><span class="Delimiter">;</span>
+  trace<span class="Delimiter">(</span><span class="Constant">&quot;test layer 2&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;bar&quot;</span><span class="Delimiter">;</span>
+  trace<span class="Delimiter">(</span><span class="Constant">&quot;test layer 1&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;qux&quot;</span><span class="Delimiter">;</span>
+  CHECK_TRACE_CONTENTS<span class="Delimiter">(</span><span class="Constant">&quot;&quot;</span><span class="Delimiter">,</span> <span class="Constant">&quot;foo^Dbar^Dqux^D&quot;</span><span class="Delimiter">);</span>
+<span class="Delimiter">}</span>
+
+void test_trace_orders_across_layers2<span class="Delimiter">()</span> <span class="Delimiter">{</span>
+  trace<span class="Delimiter">(</span><span class="Constant">&quot;test layer 1&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;foo&quot;</span><span class="Delimiter">;</span>
+  trace<span class="Delimiter">(</span><span class="Constant">&quot;test layer 2&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;bar&quot;</span><span class="Delimiter">;</span>
+  trace<span class="Delimiter">(</span><span class="Constant">&quot;test layer 1&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;qux&quot;</span><span class="Delimiter">;</span>
+  CHECK_TRACE_CONTENTS<span class="Delimiter">(</span><span class="Constant">&quot;foo^Dbar^Dqux^D&quot;</span><span class="Delimiter">);</span>
+<span class="Delimiter">}</span>
+
+void test_trace_checks_ordering_spanning_multiple_layers<span class="Delimiter">()</span> <span class="Delimiter">{</span>
+  trace<span class="Delimiter">(</span><span class="Constant">&quot;layer1&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;foo&quot;</span><span class="Delimiter">;</span>
+  trace<span class="Delimiter">(</span><span class="Constant">&quot;layer2&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;bar&quot;</span><span class="Delimiter">;</span>
+  trace<span class="Delimiter">(</span><span class="Constant">&quot;layer1&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;qux&quot;</span><span class="Delimiter">;</span>
+  CHECK_TRACE_CONTENTS<span class="Delimiter">(</span><span class="Constant">&quot;layer1: foo^Dlayer2: bar^Dlayer1: qux^D&quot;</span><span class="Delimiter">);</span>
+<span class="Delimiter">}</span>
+
+void test_trace_segments_within_layers<span class="Delimiter">()</span> <span class="Delimiter">{</span>
+  trace<span class="Delimiter">(</span><span class="Constant">&quot;test layer 1&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;foo&quot;</span><span class="Delimiter">;</span>
+  trace<span class="Delimiter">(</span><span class="Constant">&quot;test layer 2&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;bar&quot;</span><span class="Delimiter">;</span>
+  new_trace_frame<span class="Delimiter">(</span><span class="Constant">&quot;test layer 1&quot;</span><span class="Delimiter">);</span>
+  trace<span class="Delimiter">(</span><span class="Constant">&quot;test layer 1&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;qux&quot;</span><span class="Delimiter">;</span>
+  CHECK_TRACE_CONTENTS<span class="Delimiter">(</span><span class="Constant">&quot;test layer 1&quot;</span><span class="Delimiter">,</span> <span class="Constant">&quot;foo^Dqux^D&quot;</span><span class="Delimiter">);</span>
+  CHECK_TRACE_CONTENTS<span class="Delimiter">(</span><span class="Constant">&quot;test layer 1&quot;</span><span class="Delimiter">,</span> <span class="Constant">0</span><span class="Delimiter">,</span> <span class="Constant">&quot;foo^D&quot;</span><span class="Delimiter">);</span>
+  CHECK_TRACE_DOESNT_CONTAIN<span class="Delimiter">(</span><span class="Constant">&quot;test layer 1&quot;</span><span class="Delimiter">,</span> <span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">&quot;foo^D&quot;</span><span class="Delimiter">);</span>
+<span class="Delimiter">}</span>
+
+void test_trace_checks_ordering_across_layers_and_frames<span class="Delimiter">()</span> <span class="Delimiter">{</span>
+  trace<span class="Delimiter">(</span><span class="Constant">&quot;test layer 1&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;foo&quot;</span><span class="Delimiter">;</span>
+  trace<span class="Delimiter">(</span><span class="Constant">&quot;test layer 2&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;bar&quot;</span><span class="Delimiter">;</span>
+  new_trace_frame<span class="Delimiter">(</span><span class="Constant">&quot;test layer 1&quot;</span><span class="Delimiter">);</span>
+  trace<span class="Delimiter">(</span><span class="Constant">&quot;test layer 1&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;qux&quot;</span><span class="Delimiter">;</span>
+  CHECK_TRACE_CONTENTS<span class="Delimiter">(</span><span class="Constant">&quot;test layer 1/0: foo^Dtest layer 2: bar^Dtest layer 1: qux&quot;</span><span class="Delimiter">);</span>
+  CHECK_TRACE_CONTENTS<span class="Delimiter">(</span><span class="Constant">&quot;test layer 1: foo^Dtest layer 2: bar^Dtest layer 1/1: qux&quot;</span><span class="Delimiter">);</span>
+<span class="Delimiter">}</span>
+
+void trace_test_fn<span class="Delimiter">(</span>int n<span class="Delimiter">)</span> <span class="Delimiter">{</span>
+  if <span class="Delimiter">(</span>n == <span class="Constant">0</span><span class="Delimiter">)</span> <span class="Identifier">return</span><span class="Delimiter">;</span>
+  new_trace_frame<span class="Delimiter">(</span><span class="Constant">&quot;foo&quot;</span><span class="Delimiter">);</span>
+  trace<span class="Delimiter">(</span><span class="Constant">&quot;foo&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;before: &quot;</span> &lt;&lt; n<span class="Delimiter">;</span>
+  trace_test_fn<span class="Delimiter">(</span>n-<span class="Constant">1</span><span class="Delimiter">);</span>
+  trace<span class="Delimiter">(</span><span class="Constant">&quot;foo&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;after: &quot;</span> &lt;&lt; n<span class="Delimiter">;</span>
+<span class="Delimiter">}</span>
+
+void test_trace_keeps_level_together<span class="Delimiter">()</span> <span class="Delimiter">{</span>
+  CHECK_TRACE_CONTENTS<span class="Delimiter">(</span><span class="Constant">&quot;foo&quot;</span><span class="Delimiter">,</span> <span class="Constant">&quot;&quot;</span><span class="Delimiter">);</span>
+  trace_test_fn<span class="Delimiter">(</span><span class="Constant">4</span><span class="Delimiter">);</span>
+  CHECK_TRACE_CONTENTS<span class="Delimiter">(</span><span class="Constant">&quot;foo&quot;</span><span class="Delimiter">,</span> <span class="Constant">2</span><span class="Delimiter">,</span> <span class="Constant">&quot;before: 3^Dafter: 3^D&quot;</span><span class="Delimiter">);</span>
+<span class="Delimiter">}</span>
+
+void test_trace_supports_multiple_layers<span class="Delimiter">()</span> <span class="Delimiter">{</span>
+  trace<span class="Delimiter">(</span><span class="Constant">&quot;test layer 1&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;foo&quot;</span><span class="Delimiter">;</span>
+  trace<span class="Delimiter">(</span><span class="Constant">&quot;test layer 2&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;bar&quot;</span><span class="Delimiter">;</span>
+  trace<span class="Delimiter">(</span><span class="Constant">&quot;test layer 1&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;qux&quot;</span><span class="Delimiter">;</span>
+  CHECK_TRACE_CONTENTS<span class="Delimiter">(</span><span class="Constant">&quot;test layer 1,test layer 2&quot;</span><span class="Delimiter">,</span> <span class="Constant">&quot;foo^Dbar^Dqux^D&quot;</span><span class="Delimiter">);</span>
+<span class="Delimiter">}</span>
+
+void test_trace_supports_hierarchical_layers<span class="Delimiter">()</span> <span class="Delimiter">{</span>
+  trace<span class="Delimiter">(</span><span class="Constant">&quot;test layer/a&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;foo&quot;</span><span class="Delimiter">;</span>
+  trace<span class="Delimiter">(</span><span class="Constant">&quot;different layer/c&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;foo 2&quot;</span><span class="Delimiter">;</span>
+  trace<span class="Delimiter">(</span><span class="Constant">&quot;test layer/b&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;bar&quot;</span><span class="Delimiter">;</span>
+  CHECK_TRACE_CONTENTS<span class="Delimiter">(</span><span class="Constant">&quot;test layer/&quot;</span><span class="Delimiter">,</span> <span class="Constant">&quot;foo^Dbar^D&quot;</span><span class="Delimiter">);</span>
+<span class="Delimiter">}</span>
+
+void test_trace_supports_count<span class="Delimiter">()</span> <span class="Delimiter">{</span>
+  trace<span class="Delimiter">(</span><span class="Constant">&quot;test layer 1&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;foo&quot;</span><span class="Delimiter">;</span>
+  trace<span class="Delimiter">(</span><span class="Constant">&quot;test layer 1&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;foo&quot;</span><span class="Delimiter">;</span>
+  CHECK_EQ<span class="Delimiter">(</span>trace_count<span class="Delimiter">(</span><span class="Constant">&quot;test layer 1&quot;</span><span class="Delimiter">,</span> <span class="Constant">&quot;foo&quot;</span><span class="Delimiter">),</span> <span class="Constant">2</span><span class="Delimiter">);</span>
+<span class="Delimiter">}</span>
+
+void test_trace_supports_count2<span class="Delimiter">()</span> <span class="Delimiter">{</span>
+  trace<span class="Delimiter">(</span><span class="Constant">&quot;test layer 1&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;foo&quot;</span><span class="Delimiter">;</span>
+  trace<span class="Delimiter">(</span><span class="Constant">&quot;test layer 1&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;bar&quot;</span><span class="Delimiter">;</span>
+  CHECK_EQ<span class="Delimiter">(</span>trace_count<span class="Delimiter">(</span><span class="Constant">&quot;test layer 1&quot;</span><span class="Delimiter">),</span> <span class="Constant">2</span><span class="Delimiter">);</span>
+<span class="Delimiter">}</span>
+
+<span class="Comment">// pending: DUMP tests</span>
+<span class="Comment">// pending: readable_contents() adds newline if necessary.</span>
+<span class="Comment">// pending: raise also prints to stderr.</span>
+<span class="Comment">// pending: raise doesn't print to stderr if Hide_warnings is set.</span>
+<span class="Comment">// pending: raise doesn't have to be saved if Hide_warnings is set, just printed.</span>
+<span class="Comment">// pending: raise prints to stderr if Trace_stream is NULL.</span>
+<span class="Comment">// pending: raise prints to stderr if Trace_stream is NULL even if Hide_warnings is set.</span>
+<span class="Comment">// pending: raise &lt;&lt; ... die() doesn't die if Hide_warnings is set.</span>
+
+^L
+
+<span class="Comment">// can't check trace because trace methods call 'split'</span>
+
+void test_split_returns_at_least_one_elem<span class="Delimiter">()</span> <span class="Delimiter">{</span>
+  vector&lt;string&gt; result = split<span class="Delimiter">(</span><span class="Constant">&quot;&quot;</span><span class="Delimiter">,</span> <span class="Constant">&quot;,&quot;</span><span class="Delimiter">);</span>
+  CHECK_EQ<span class="Delimiter">(</span>result<span class="Delimiter">.</span>size<span class="Delimiter">(),</span> <span class="Constant">1</span><span class="Delimiter">);</span>
+  CHECK_EQ<span class="Delimiter">(</span>result[<span class="Constant">0</span>]<span class="Delimiter">,</span> <span class="Constant">&quot;&quot;</span><span class="Delimiter">);</span>
+<span class="Delimiter">}</span>
+
+void test_split_returns_entire_input_when_no_delim<span class="Delimiter">()</span> <span class="Delimiter">{</span>
+  vector&lt;string&gt; result = split<span class="Delimiter">(</span><span class="Constant">&quot;abc&quot;</span><span class="Delimiter">,</span> <span class="Constant">&quot;,&quot;</span><span class="Delimiter">);</span>
+  CHECK_EQ<span class="Delimiter">(</span>result<span class="Delimiter">.</span>size<span class="Delimiter">(),</span> <span class="Constant">1</span><span class="Delimiter">);</span>
+  CHECK_EQ<span class="Delimiter">(</span>result[<span class="Constant">0</span>]<span class="Delimiter">,</span> <span class="Constant">&quot;abc&quot;</span><span class="Delimiter">);</span>
+<span class="Delimiter">}</span>
+
+void test_split_works<span class="Delimiter">()</span> <span class="Delimiter">{</span>
+  vector&lt;string&gt; result = split<span class="Delimiter">(</span><span class="Constant">&quot;abc,def&quot;</span><span class="Delimiter">,</span> <span class="Constant">&quot;,&quot;</span><span class="Delimiter">);</span>
+  CHECK_EQ<span class="Delimiter">(</span>result<span class="Delimiter">.</span>size<span class="Delimiter">(),</span> <span class="Constant">2</span><span class="Delimiter">);</span>
+  CHECK_EQ<span class="Delimiter">(</span>result[<span class="Constant">0</span>]<span class="Delimiter">,</span> <span class="Constant">&quot;abc&quot;</span><span class="Delimiter">);</span>
+  CHECK_EQ<span class="Delimiter">(</span>result[<span class="Constant">1</span>]<span class="Delimiter">,</span> <span class="Constant">&quot;def&quot;</span><span class="Delimiter">);</span>
+<span class="Delimiter">}</span>
+
+void test_split_works2<span class="Delimiter">()</span> <span class="Delimiter">{</span>
+  vector&lt;string&gt; result = split<span class="Delimiter">(</span><span class="Constant">&quot;abc,def,ghi&quot;</span><span class="Delimiter">,</span> <span class="Constant">&quot;,&quot;</span><span class="Delimiter">);</span>
+  CHECK_EQ<span class="Delimiter">(</span>result<span class="Delimiter">.</span>size<span class="Delimiter">(),</span> <span class="Constant">3</span><span class="Delimiter">);</span>
+  CHECK_EQ<span class="Delimiter">(</span>result[<span class="Constant">0</span>]<span class="Delimiter">,</span> <span class="Constant">&quot;abc&quot;</span><span class="Delimiter">);</span>
+  CHECK_EQ<span class="Delimiter">(</span>result[<span class="Constant">1</span>]<span class="Delimiter">,</span> <span class="Constant">&quot;def&quot;</span><span class="Delimiter">);</span>
+  CHECK_EQ<span class="Delimiter">(</span>result[<span class="Constant">2</span>]<span class="Delimiter">,</span> <span class="Constant">&quot;ghi&quot;</span><span class="Delimiter">);</span>
+<span class="Delimiter">}</span>
+
+void test_split_handles_multichar_delim<span class="Delimiter">()</span> <span class="Delimiter">{</span>
+  vector&lt;string&gt; result = split<span class="Delimiter">(</span><span class="Constant">&quot;abc,,def,,ghi&quot;</span><span class="Delimiter">,</span> <span class="Constant">&quot;,,&quot;</span><span class="Delimiter">);</span>
+  CHECK_EQ<span class="Delimiter">(</span>result<span class="Delimiter">.</span>size<span class="Delimiter">(),</span> <span class="Constant">3</span><span class="Delimiter">);</span>
+  CHECK_EQ<span class="Delimiter">(</span>result[<span class="Constant">0</span>]<span class="Delimiter">,</span> <span class="Constant">&quot;abc&quot;</span><span class="Delimiter">);</span>
+  CHECK_EQ<span class="Delimiter">(</span>result[<span class="Constant">1</span>]<span class="Delimiter">,</span> <span class="Constant">&quot;def&quot;</span><span class="Delimiter">);</span>
+  CHECK_EQ<span class="Delimiter">(</span>result[<span class="Constant">2</span>]<span class="Delimiter">,</span> <span class="Constant">&quot;ghi&quot;</span><span class="Delimiter">);</span>
+<span class="Delimiter">}</span>
+</pre>
+</body>
+</html>
+<!-- vim: set foldmethod=manual : -->