Example #1
0
 def tag_start_end(case, raw):
     start1, end1, start2, end2, tag = formatter.get_first_tag(raw)
     tag.should.equal("rune")
     start1.should.be.within(0,5)
     end1.should.equal(start1 + len('<!-- rune -->'))
     start2.should.equal(start1 + len('<!-- rune -->foo'))
     end2.should.equal(start2 + len('<!-- /rune -->'))
     raw[end1:start2].should.equal("foo")
Example #2
0
 def first_tag(case):
     raw = "1234<!-- rune -->5678"
     start1, end1, start2, end2, tag = formatter.get_first_tag(raw)
     tag.should.equal("rune")
     start1.should.equal(4)
     end1.should.equal(17)
     start2.should.equal(end2)
     end2.should.equal(-1)
     (raw[:start1] + raw[end1:]).should.equal("12345678")
Example #3
0
 def tag_full(case, cmd):
     txt = "<!-- rune:%s -->" % cmd
     a, b, c, d, tag = formatter.get_first_tag(txt)
     tag.should.equal("rune:%s" % cmd)