
Helper for writing tests
create_test_text.RdSneaky way for testing. Flatten a segment element, fix the names to select the list
element (. to $ and trail numbers with [[]]), and create string to use with expect_equal().
cat() the result and paste into test script. An even sneaker thing is to parse
the text and evaluate it.
zz = create_test_text(segment)
eval(parse(text = zz))