Skip to content

Commit

Permalink
test: Add test for blank lines
Browse files Browse the repository at this point in the history
  • Loading branch information
aureliojargas committed Sep 21, 2019
1 parent 4c6ec38 commit 3665234
Show file tree
Hide file tree
Showing 5 changed files with 279 additions and 0 deletions.
90 changes: 90 additions & 0 deletions test/debug/blank-lines.sed.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
PATT:one$
HOLD:$
COMM:p
one
PATT:one$
HOLD:$
COMM:p
one
PATT:one$
HOLD:$
COMM:p
one
PATT:one$
HOLD:$
one
PATT:two$
HOLD:$
COMM:p
two
PATT:two$
HOLD:$
COMM:p
two
PATT:two$
HOLD:$
COMM:p
two
PATT:two$
HOLD:$
two
PATT:three$
HOLD:$
COMM:p
three
PATT:three$
HOLD:$
COMM:p
three
PATT:three$
HOLD:$
COMM:p
three
PATT:three$
HOLD:$
three
PATT:four$
HOLD:$
COMM:p
four
PATT:four$
HOLD:$
COMM:p
four
PATT:four$
HOLD:$
COMM:p
four
PATT:four$
HOLD:$
four
PATT:five$
HOLD:$
COMM:p
five
PATT:five$
HOLD:$
COMM:p
five
PATT:five$
HOLD:$
COMM:p
five
PATT:five$
HOLD:$
five
PATT:six$
HOLD:$
COMM:p
six
PATT:six$
HOLD:$
COMM:p
six
PATT:six$
HOLD:$
COMM:p
six
PATT:six$
HOLD:$
six
49 changes: 49 additions & 0 deletions test/dumpdebug/blank-lines.sed
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# blank lines at the top should be preserved
# blank lines between comments should be preserved
# single, consecutive and EOF blanks lines should be preserved
s/^/PATT:/
l
s/^PATT://
x
s/^/HOLD:/
l
s/^HOLD://
x
i\
COMM:p
#--------------------------------------------------
p
s/^/PATT:/
l
s/^PATT://
x
s/^/HOLD:/
l
s/^HOLD://
x
i\
COMM:p
#--------------------------------------------------
p
s/^/PATT:/
l
s/^PATT://
x
s/^/HOLD:/
l
s/^HOLD://
x
i\
COMM:p
#--------------------------------------------------
p
s/^/PATT:/
l
s/^PATT://
x
s/^/HOLD:/
l
s/^HOLD://
x

# Debugged SED script generated by sedsed (https://aurelio.net/projects/sedsed/)
27 changes: 27 additions & 0 deletions test/html/blank-lines.sed.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<html>
<head><meta name="Generator" content="sedsed --htmlize">
<title>Colorized blank-lines.sed</title></head>
<body bgcolor="#000000" text="#ffffff"
link="#ff00ff" alink="#ff00ff" vlink="#ff00ff">
<pre>


<font color="#00ffff"><b># blank lines at the top should be preserved</b></font>

<font color="#00ffff"><b># blank lines between comments should be preserved</b></font>


<font color="#00ffff"><b># single, consecutive and EOF blanks lines should be preserved</b></font>
<font color="#ffff00"><b>p</b></font>

<font color="#ffff00"><b>p</b></font>



<font color="#ffff00"><b>p</b></font>



<font color="#00ffff"><b>### colorized by <a href="https://aurelio.net/projects/sedsed/">sedsed</a>, a debugger and code formatter for sed scripts</b></font>

</pre></body></html>
17 changes: 17 additions & 0 deletions test/parsing/blank-lines.sed
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@


# blank lines at the top should be preserved

# blank lines between comments should be preserved


# single, consecutive and EOF blanks lines should be preserved
p

p



p


96 changes: 96 additions & 0 deletions test/token/blank-lines.sed.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
linenr:3
addr1:
addr1flag:
addr2:
addr2flag:
lastaddr:
modifier:
id:#
content:
delimiter:
pattern:
replace:
flag:
extrainfo:
comment:# blank lines at the top should be preserved

linenr:5
addr1:
addr1flag:
addr2:
addr2flag:
lastaddr:
modifier:
id:#
content:
delimiter:
pattern:
replace:
flag:
extrainfo:
comment:# blank lines between comments should be preserved

linenr:8
addr1:
addr1flag:
addr2:
addr2flag:
lastaddr:
modifier:
id:#
content:
delimiter:
pattern:
replace:
flag:
extrainfo:
comment:# single, consecutive and EOF blanks lines should be preserved

linenr:9
addr1:
addr1flag:
addr2:
addr2flag:
lastaddr:
modifier:
id:p
content:
delimiter:
pattern:
replace:
flag:
extrainfo:
comment:

linenr:11
addr1:
addr1flag:
addr2:
addr2flag:
lastaddr:
modifier:
id:p
content:
delimiter:
pattern:
replace:
flag:
extrainfo:
comment:

linenr:15
addr1:
addr1flag:
addr2:
addr2flag:
lastaddr:
modifier:
id:p
content:
delimiter:
pattern:
replace:
flag:
extrainfo:
comment:

0 comments on commit 3665234

Please sign in to comment.