Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
b16e6ab1
Commit
b16e6ab1
authored
Nov 05, 2009
by
Robert Griesemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gofmt-ify tabwriter
R=rsc
http://go/go-review/1017042
parent
1fede304
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
78 additions
and
73 deletions
+78
-73
tabwriter.go
src/pkg/tabwriter/tabwriter.go
+24
-19
tabwriter_test.go
src/pkg/tabwriter/tabwriter_test.go
+54
-54
No files found.
src/pkg/tabwriter/tabwriter.go
View file @
b16e6ab1
...
@@ -142,7 +142,7 @@ func (b *Writer) reset() {
...
@@ -142,7 +142,7 @@ func (b *Writer) reset() {
const
(
const
(
// Ignore html tags and treat entities (starting with '&'
// Ignore html tags and treat entities (starting with '&'
// and ending in ';') as single characters (width = 1).
// and ending in ';') as single characters (width = 1).
FilterHTML
uint
=
1
<<
iota
;
FilterHTML
uint
=
1
<<
iota
;
// Force right-alignment of cell content.
// Force right-alignment of cell content.
// Default is left-alignment.
// Default is left-alignment.
...
@@ -187,7 +187,7 @@ func (b *Writer) Init(output io.Writer, cellwidth, padding int, padchar byte, fl
...
@@ -187,7 +187,7 @@ func (b *Writer) Init(output io.Writer, cellwidth, padding int, padchar byte, fl
b
.
output
=
output
;
b
.
output
=
output
;
b
.
cellwidth
=
cellwidth
;
b
.
cellwidth
=
cellwidth
;
b
.
padding
=
padding
;
b
.
padding
=
padding
;
for
i
:=
len
(
b
.
padbytes
)
-
1
;
i
>=
0
;
i
--
{
for
i
:=
len
(
b
.
padbytes
)
-
1
;
i
>=
0
;
i
--
{
b
.
padbytes
[
i
]
=
padchar
;
b
.
padbytes
[
i
]
=
padchar
;
}
}
if
padchar
==
'\t'
{
if
padchar
==
'\t'
{
...
@@ -238,7 +238,7 @@ func (b *Writer) writePadding(textw, cellw int) os.Error {
...
@@ -238,7 +238,7 @@ func (b *Writer) writePadding(textw, cellw int) os.Error {
cellw
=
((
cellw
+
b
.
cellwidth
-
1
)
/
b
.
cellwidth
)
*
b
.
cellwidth
;
cellw
=
((
cellw
+
b
.
cellwidth
-
1
)
/
b
.
cellwidth
)
*
b
.
cellwidth
;
}
}
n
:=
cellw
-
textw
;
n
:=
cellw
-
textw
;
if
n
<
0
{
if
n
<
0
{
panic
(
"internal error"
);
panic
(
"internal error"
);
}
}
...
@@ -254,11 +254,11 @@ func (b *Writer) writePadding(textw, cellw int) os.Error {
...
@@ -254,11 +254,11 @@ func (b *Writer) writePadding(textw, cellw int) os.Error {
n
-=
len
(
b
.
padbytes
);
n
-=
len
(
b
.
padbytes
);
}
}
return
b
.
write0
(
b
.
padbytes
[
0
:
n
]);
return
b
.
write0
(
b
.
padbytes
[
0
:
n
]);
}
}
var
vbar
=
[]
byte
{
'|'
}
;
var
vbar
=
[]
byte
{
'|'
}
func
(
b
*
Writer
)
writeLines
(
pos0
int
,
line0
,
line1
int
)
(
pos
int
,
err
os
.
Error
)
{
func
(
b
*
Writer
)
writeLines
(
pos0
int
,
line0
,
line1
int
)
(
pos
int
,
err
os
.
Error
)
{
pos
=
pos0
;
pos
=
pos0
;
...
@@ -267,7 +267,7 @@ func (b *Writer) writeLines(pos0 int, line0, line1 int) (pos int, err os.Error)
...
@@ -267,7 +267,7 @@ func (b *Writer) writeLines(pos0 int, line0, line1 int) (pos int, err os.Error)
for
j
:=
0
;
j
<
line
.
Len
();
j
++
{
for
j
:=
0
;
j
<
line
.
Len
();
j
++
{
c
:=
line
.
At
(
j
)
.
(
cell
);
c
:=
line
.
At
(
j
)
.
(
cell
);
if
j
>
0
&&
b
.
flags
&
Debug
!=
0
{
if
j
>
0
&&
b
.
flags
&
Debug
!=
0
{
if
err
=
b
.
write0
(
vbar
);
err
!=
nil
{
if
err
=
b
.
write0
(
vbar
);
err
!=
nil
{
return
;
return
;
}
}
...
@@ -359,7 +359,7 @@ func (b *Writer) format(pos0 int, line0, line1 int) (pos int, err os.Error) {
...
@@ -359,7 +359,7 @@ func (b *Writer) format(pos0 int, line0, line1 int) (pos int, err os.Error) {
discardable
=
false
;
discardable
=
false
;
}
}
}
else
{
}
else
{
break
break
;
}
}
}
}
// column block end
// column block end
...
@@ -404,15 +404,18 @@ func (b *Writer) updateWidth() {
...
@@ -404,15 +404,18 @@ func (b *Writer) updateWidth() {
//
//
// The value 0xff was chosen because it cannot appear in a valid UTF-8 sequence.
// The value 0xff was chosen because it cannot appear in a valid UTF-8 sequence.
//
//
const
Escape
=
'\xff'
const
Escape
=
'\xff'
// Start escaped mode.
// Start escaped mode.
func
(
b
*
Writer
)
startEscape
(
ch
byte
)
{
func
(
b
*
Writer
)
startEscape
(
ch
byte
)
{
switch
ch
{
switch
ch
{
case
Escape
:
b
.
endChar
=
Escape
;
case
Escape
:
case
'<'
:
b
.
endChar
=
'>'
;
b
.
endChar
=
Escape
;
case
'&'
:
b
.
endChar
=
';'
;
case
'<'
:
b
.
endChar
=
'>'
;
case
'&'
:
b
.
endChar
=
';'
;
}
}
}
}
...
@@ -424,9 +427,11 @@ func (b *Writer) startEscape(ch byte) {
...
@@ -424,9 +427,11 @@ func (b *Writer) startEscape(ch byte) {
//
//
func
(
b
*
Writer
)
endEscape
()
{
func
(
b
*
Writer
)
endEscape
()
{
switch
b
.
endChar
{
switch
b
.
endChar
{
case
Escape
:
b
.
updateWidth
();
case
Escape
:
b
.
updateWidth
();
case
'>'
:
// tag of zero width
case
'>'
:
// tag of zero width
case
';'
:
b
.
cell
.
width
++
;
// entity, count as one rune
case
';'
:
b
.
cell
.
width
++
;
// entity, count as one rune
}
}
b
.
pos
=
b
.
buf
.
Len
();
b
.
pos
=
b
.
buf
.
Len
();
b
.
endChar
=
0
;
b
.
endChar
=
0
;
...
@@ -483,7 +488,7 @@ func (b *Writer) Write(buf []byte) (n int, err os.Error) {
...
@@ -483,7 +488,7 @@ func (b *Writer) Write(buf []byte) (n int, err os.Error) {
switch
ch
{
switch
ch
{
case
'\t'
,
'\v'
,
'\n'
,
'\f'
:
case
'\t'
,
'\v'
,
'\n'
,
'\f'
:
// end of cell
// end of cell
b
.
append
(
buf
[
n
:
i
]);
b
.
append
(
buf
[
n
:
i
]);
b
.
updateWidth
();
b
.
updateWidth
();
n
=
i
+
1
;
// ch consumed
n
=
i
+
1
;
// ch consumed
ncells
:=
b
.
terminateCell
(
ch
==
'\t'
);
ncells
:=
b
.
terminateCell
(
ch
==
'\t'
);
...
@@ -504,7 +509,7 @@ func (b *Writer) Write(buf []byte) (n int, err os.Error) {
...
@@ -504,7 +509,7 @@ func (b *Writer) Write(buf []byte) (n int, err os.Error) {
case
Escape
:
case
Escape
:
// start of escaped sequence
// start of escaped sequence
b
.
append
(
buf
[
n
:
i
]);
b
.
append
(
buf
[
n
:
i
]);
b
.
updateWidth
();
b
.
updateWidth
();
n
=
i
+
1
;
// exclude Escape
n
=
i
+
1
;
// exclude Escape
b
.
startEscape
(
Escape
);
b
.
startEscape
(
Escape
);
...
@@ -513,7 +518,7 @@ func (b *Writer) Write(buf []byte) (n int, err os.Error) {
...
@@ -513,7 +518,7 @@ func (b *Writer) Write(buf []byte) (n int, err os.Error) {
// possibly an html tag/entity
// possibly an html tag/entity
if
b
.
flags
&
FilterHTML
!=
0
{
if
b
.
flags
&
FilterHTML
!=
0
{
// begin of tag/entity
// begin of tag/entity
b
.
append
(
buf
[
n
:
i
]);
b
.
append
(
buf
[
n
:
i
]);
b
.
updateWidth
();
b
.
updateWidth
();
n
=
i
;
n
=
i
;
b
.
startEscape
(
ch
);
b
.
startEscape
(
ch
);
...
@@ -528,7 +533,7 @@ func (b *Writer) Write(buf []byte) (n int, err os.Error) {
...
@@ -528,7 +533,7 @@ func (b *Writer) Write(buf []byte) (n int, err os.Error) {
if
ch
==
Escape
{
if
ch
==
Escape
{
j
=
i
;
// exclude Escape
j
=
i
;
// exclude Escape
}
}
b
.
append
(
buf
[
n
:
j
]);
b
.
append
(
buf
[
n
:
j
]);
n
=
i
+
1
;
// ch consumed
n
=
i
+
1
;
// ch consumed
b
.
endEscape
();
b
.
endEscape
();
}
}
...
@@ -536,7 +541,7 @@ func (b *Writer) Write(buf []byte) (n int, err os.Error) {
...
@@ -536,7 +541,7 @@ func (b *Writer) Write(buf []byte) (n int, err os.Error) {
}
}
// append leftover text
// append leftover text
b
.
append
(
buf
[
n
:
len
(
buf
)]);
b
.
append
(
buf
[
n
:
len
(
buf
)]);
n
=
len
(
buf
);
n
=
len
(
buf
);
return
;
return
;
}
}
...
@@ -546,5 +551,5 @@ func (b *Writer) Write(buf []byte) (n int, err os.Error) {
...
@@ -546,5 +551,5 @@ func (b *Writer) Write(buf []byte) (n int, err os.Error) {
// The parameters are the same as for the the Init function.
// The parameters are the same as for the the Init function.
//
//
func
NewWriter
(
output
io
.
Writer
,
cellwidth
,
padding
int
,
padchar
byte
,
flags
uint
)
*
Writer
{
func
NewWriter
(
output
io
.
Writer
,
cellwidth
,
padding
int
,
padchar
byte
,
flags
uint
)
*
Writer
{
return
new
(
Writer
)
.
Init
(
output
,
cellwidth
,
padding
,
padchar
,
flags
)
return
new
(
Writer
)
.
Init
(
output
,
cellwidth
,
padding
,
padchar
,
flags
)
;
}
}
src/pkg/tabwriter/tabwriter_test.go
View file @
b16e6ab1
...
@@ -17,20 +17,20 @@ type buffer struct {
...
@@ -17,20 +17,20 @@ type buffer struct {
func
(
b
*
buffer
)
init
(
n
int
)
{
func
(
b
*
buffer
)
init
(
n
int
)
{
b
.
a
=
make
([]
byte
,
n
)[
0
:
0
];
b
.
a
=
make
([]
byte
,
n
)[
0
:
0
];
}
}
func
(
b
*
buffer
)
clear
()
{
func
(
b
*
buffer
)
clear
()
{
b
.
a
=
b
.
a
[
0
:
0
];
b
.
a
=
b
.
a
[
0
:
0
];
}
}
func
(
b
*
buffer
)
Write
(
buf
[]
byte
)
(
written
int
,
err
os
.
Error
)
{
func
(
b
*
buffer
)
Write
(
buf
[]
byte
)
(
written
int
,
err
os
.
Error
)
{
n
:=
len
(
b
.
a
);
n
:=
len
(
b
.
a
);
m
:=
len
(
buf
);
m
:=
len
(
buf
);
if
n
+
m
<=
cap
(
b
.
a
)
{
if
n
+
m
<=
cap
(
b
.
a
)
{
b
.
a
=
b
.
a
[
0
:
n
+
m
];
b
.
a
=
b
.
a
[
0
:
n
+
m
];
for
i
:=
0
;
i
<
m
;
i
++
{
for
i
:=
0
;
i
<
m
;
i
++
{
b
.
a
[
n
+
i
]
=
buf
[
i
];
b
.
a
[
n
+
i
]
=
buf
[
i
];
}
}
...
@@ -65,7 +65,7 @@ func verify(t *testing.T, testname string, w *Writer, b *buffer, src, expected s
...
@@ -65,7 +65,7 @@ func verify(t *testing.T, testname string, w *Writer, b *buffer, src, expected s
res
:=
b
.
String
();
res
:=
b
.
String
();
if
res
!=
expected
{
if
res
!=
expected
{
t
.
Errorf
(
"--- test: %s
\n
--- src:
\n
%s
\n
--- found:
\n
%s
\n
--- expected:
\n
%s
\n
"
,
testname
,
src
,
res
,
expected
)
t
.
Errorf
(
"--- test: %s
\n
--- src:
\n
%s
\n
--- found:
\n
%s
\n
--- expected:
\n
%s
\n
"
,
testname
,
src
,
res
,
expected
)
;
}
}
}
}
...
@@ -95,7 +95,7 @@ func check(t *testing.T, testname string, tabwidth, padding int, padchar byte, f
...
@@ -95,7 +95,7 @@ func check(t *testing.T, testname string, tabwidth, padding int, padchar byte, f
write
(
t
,
testname
,
&
w
,
src
[
i
:
i
+
d
]);
write
(
t
,
testname
,
&
w
,
src
[
i
:
i
+
d
]);
i
,
d
=
i
+
d
,
d
+
1
;
i
,
d
=
i
+
d
,
d
+
1
;
if
i
+
d
>
len
(
src
)
{
if
i
+
d
>
len
(
src
)
{
d
=
len
(
src
)
-
i
;
d
=
len
(
src
)
-
i
;
}
}
}
}
verify
(
t
,
testname
,
&
w
,
&
b
,
src
,
expected
);
verify
(
t
,
testname
,
&
w
,
&
b
,
src
,
expected
);
...
@@ -111,33 +111,33 @@ type entry struct {
...
@@ -111,33 +111,33 @@ type entry struct {
}
}
var
tests
=
[]
entry
{
var
tests
=
[]
entry
{
entry
{
entry
{
"1a"
,
"1a"
,
8
,
1
,
'.'
,
0
,
8
,
1
,
'.'
,
0
,
""
,
""
,
""
""
,
},
},
entry
{
entry
{
"1a debug"
,
"1a debug"
,
8
,
1
,
'.'
,
Debug
,
8
,
1
,
'.'
,
Debug
,
""
,
""
,
""
""
,
},
},
entry
{
entry
{
"1b esc"
,
"1b esc"
,
8
,
1
,
'.'
,
0
,
8
,
1
,
'.'
,
0
,
"
\xff\xff
"
,
"
\xff\xff
"
,
""
""
,
},
},
entry
{
entry
{
"1c esc"
,
"1c esc"
,
8
,
1
,
'.'
,
0
,
8
,
1
,
'.'
,
0
,
"
\xff\t\xff
"
,
"
\xff\t\xff
"
,
"
\t
"
"
\t
"
,
},
},
entry
{
entry
{
...
@@ -158,133 +158,133 @@ var tests = []entry {
...
@@ -158,133 +158,133 @@ var tests = []entry {
"2"
,
"2"
,
8
,
1
,
'.'
,
0
,
8
,
1
,
'.'
,
0
,
"
\n\n\n
"
,
"
\n\n\n
"
,
"
\n\n\n
"
"
\n\n\n
"
,
},
},
entry
{
entry
{
"3"
,
"3"
,
8
,
1
,
'.'
,
0
,
8
,
1
,
'.'
,
0
,
"a
\n
b
\n
c"
,
"a
\n
b
\n
c"
,
"a
\n
b
\n
c"
"a
\n
b
\n
c"
,
},
},
entry
{
entry
{
"4a"
,
"4a"
,
8
,
1
,
'.'
,
0
,
8
,
1
,
'.'
,
0
,
"
\t
"
,
// '\t' terminates an empty cell on last line - nothing to print
"
\t
"
,
// '\t' terminates an empty cell on last line - nothing to print
""
""
,
},
},
entry
{
entry
{
"4b"
,
"4b"
,
8
,
1
,
'.'
,
AlignRight
,
8
,
1
,
'.'
,
AlignRight
,
"
\t
"
,
// '\t' terminates an empty cell on last line - nothing to print
"
\t
"
,
// '\t' terminates an empty cell on last line - nothing to print
""
""
,
},
},
entry
{
entry
{
"5"
,
"5"
,
8
,
1
,
'.'
,
0
,
8
,
1
,
'.'
,
0
,
"*
\t
*"
,
"*
\t
*"
,
"*.......*"
"*.......*"
,
},
},
entry
{
entry
{
"5b"
,
"5b"
,
8
,
1
,
'.'
,
0
,
8
,
1
,
'.'
,
0
,
"*
\t
*
\n
"
,
"*
\t
*
\n
"
,
"*.......*
\n
"
"*.......*
\n
"
,
},
},
entry
{
entry
{
"5c"
,
"5c"
,
8
,
1
,
'.'
,
0
,
8
,
1
,
'.'
,
0
,
"*
\t
*
\t
"
,
"*
\t
*
\t
"
,
"*.......*"
"*.......*"
,
},
},
entry
{
entry
{
"5c debug"
,
"5c debug"
,
8
,
1
,
'.'
,
Debug
,
8
,
1
,
'.'
,
Debug
,
"*
\t
*
\t
"
,
"*
\t
*
\t
"
,
"*.......|*"
"*.......|*"
,
},
},
entry
{
entry
{
"5d"
,
"5d"
,
8
,
1
,
'.'
,
AlignRight
,
8
,
1
,
'.'
,
AlignRight
,
"*
\t
*
\t
"
,
"*
\t
*
\t
"
,
".......**"
".......**"
,
},
},
entry
{
entry
{
"6"
,
"6"
,
8
,
1
,
'.'
,
0
,
8
,
1
,
'.'
,
0
,
"
\t\n
"
,
"
\t\n
"
,
"........
\n
"
"........
\n
"
,
},
},
entry
{
entry
{
"7a"
,
"7a"
,
8
,
1
,
'.'
,
0
,
8
,
1
,
'.'
,
0
,
"a) foo"
,
"a) foo"
,
"a) foo"
"a) foo"
,
},
},
entry
{
entry
{
"7b"
,
"7b"
,
8
,
1
,
' '
,
0
,
8
,
1
,
' '
,
0
,
"b) foo
\t
bar"
,
"b) foo
\t
bar"
,
"b) foo bar"
"b) foo bar"
,
},
},
entry
{
entry
{
"7c"
,
"7c"
,
8
,
1
,
'.'
,
0
,
8
,
1
,
'.'
,
0
,
"c) foo
\t
bar
\t
"
,
"c) foo
\t
bar
\t
"
,
"c) foo..bar"
"c) foo..bar"
,
},
},
entry
{
entry
{
"7d"
,
"7d"
,
8
,
1
,
'.'
,
0
,
8
,
1
,
'.'
,
0
,
"d) foo
\t
bar
\n
"
,
"d) foo
\t
bar
\n
"
,
"d) foo..bar
\n
"
"d) foo..bar
\n
"
,
},
},
entry
{
entry
{
"7e"
,
"7e"
,
8
,
1
,
'.'
,
0
,
8
,
1
,
'.'
,
0
,
"e) foo
\t
bar
\t\n
"
,
"e) foo
\t
bar
\t\n
"
,
"e) foo..bar.....
\n
"
"e) foo..bar.....
\n
"
,
},
},
entry
{
entry
{
"7f"
,
"7f"
,
8
,
1
,
'.'
,
FilterHTML
,
8
,
1
,
'.'
,
FilterHTML
,
"f) f<o
\t
<b>bar</b>
\t\n
"
,
"f) f<o
\t
<b>bar</b>
\t\n
"
,
"f) f<o..<b>bar</b>.....
\n
"
"f) f<o..<b>bar</b>.....
\n
"
,
},
},
entry
{
entry
{
"7g"
,
"7g"
,
8
,
1
,
'.'
,
FilterHTML
,
8
,
1
,
'.'
,
FilterHTML
,
"g) f<o
\t
<b>bar</b>
\t
non-terminated entity &"
,
"g) f<o
\t
<b>bar</b>
\t
non-terminated entity &"
,
"g) f<o..<b>bar</b>..... non-terminated entity &"
"g) f<o..<b>bar</b>..... non-terminated entity &"
,
},
},
entry
{
entry
{
"7g debug"
,
"7g debug"
,
8
,
1
,
'.'
,
FilterHTML
|
Debug
,
8
,
1
,
'.'
,
FilterHTML
|
Debug
,
"g) f<o
\t
<b>bar</b>
\t
non-terminated entity &"
,
"g) f<o
\t
<b>bar</b>
\t
non-terminated entity &"
,
"g) f<o..|<b>bar</b>.....| non-terminated entity &"
"g) f<o..|<b>bar</b>.....| non-terminated entity &"
,
},
},
entry
{
entry
{
"8"
,
"8"
,
8
,
1
,
'*'
,
0
,
8
,
1
,
'*'
,
0
,
"Hello, world!
\n
"
,
"Hello, world!
\n
"
,
"Hello, world!
\n
"
"Hello, world!
\n
"
,
},
},
entry
{
entry
{
...
@@ -294,7 +294,7 @@ var tests = []entry {
...
@@ -294,7 +294,7 @@ var tests = []entry {
"11
\t
222
\t
3333
\t
44444
\n
"
,
"11
\t
222
\t
3333
\t
44444
\n
"
,
"1.2..3...4
\n
"
"1.2..3...4
\n
"
"11222333344444
\n
"
"11222333344444
\n
"
,
},
},
entry
{
entry
{
...
@@ -304,7 +304,7 @@ var tests = []entry {
...
@@ -304,7 +304,7 @@ var tests = []entry {
"11
\t
222
\t
3333
\t
44444
\n
"
,
"11
\t
222
\t
3333
\t
44444
\n
"
,
"1.2<!---
\f
--->..3...4
\n
"
"1.2<!---
\f
--->..3...4
\n
"
"11222333344444
\n
"
"11222333344444
\n
"
,
},
},
entry
{
entry
{
...
@@ -314,7 +314,7 @@ var tests = []entry {
...
@@ -314,7 +314,7 @@ var tests = []entry {
"11
\t
222
\t
3333
\t
44444
\n
"
,
"11
\t
222
\t
3333
\t
44444
\n
"
,
"1234
\n
"
"1234
\n
"
"11222333344444
\n
"
"11222333344444
\n
"
,
},
},
entry
{
entry
{
...
@@ -324,21 +324,21 @@ var tests = []entry {
...
@@ -324,21 +324,21 @@ var tests = []entry {
"11
\t
222
\t
3333
\t
44444
\n
"
,
"11
\t
222
\t
3333
\t
44444
\n
"
,
"1|2|3|4
\n
"
"1|2|3|4
\n
"
"11|222|3333|44444
\n
"
"11|222|3333|44444
\n
"
,
},
},
entry
{
entry
{
"10a"
,
"10a"
,
5
,
0
,
'.'
,
0
,
5
,
0
,
'.'
,
0
,
"1
\t
2
\t
3
\t
4
\n
"
,
"1
\t
2
\t
3
\t
4
\n
"
,
"1....2....3....4
\n
"
"1....2....3....4
\n
"
,
},
},
entry
{
entry
{
"10b"
,
"10b"
,
5
,
0
,
'.'
,
0
,
5
,
0
,
'.'
,
0
,
"1
\t
2
\t
3
\t
4
\t\n
"
,
"1
\t
2
\t
3
\t
4
\t\n
"
,
"1....2....3....4....
\n
"
"1....2....3....4....
\n
"
,
},
},
entry
{
entry
{
...
@@ -350,7 +350,7 @@ var tests = []entry {
...
@@ -350,7 +350,7 @@ var tests = []entry {
"本.......b.......c
\n
"
"本.......b.......c
\n
"
"aa......本本本.....cccc....ddddd
\n
"
"aa......本本本.....cccc....ddddd
\n
"
"aaa.....bbbb
\n
"
"aaa.....bbbb
\n
"
,
},
},
entry
{
entry
{
...
@@ -362,7 +362,7 @@ var tests = []entry {
...
@@ -362,7 +362,7 @@ var tests = []entry {
" a è c
\n
"
" a è c
\n
"
" aa èèè cccc ddddd
\n
"
" aa èèè cccc ddddd
\n
"
" aaa èèèè
\n
"
" aaa èèèè
\n
"
,
},
},
entry
{
entry
{
...
@@ -374,7 +374,7 @@ var tests = []entry {
...
@@ -374,7 +374,7 @@ var tests = []entry {
"a b c
\n
"
"a b c
\n
"
"aa bbbcccc
\n
"
"aa bbbcccc
\n
"
"aaabbbb
\n
"
"aaabbbb
\n
"
,
},
},
entry
{
entry
{
...
@@ -386,7 +386,7 @@ var tests = []entry {
...
@@ -386,7 +386,7 @@ var tests = []entry {
"a_______b_______c
\n
"
"a_______b_______c
\n
"
"aa______bbb_____cccc
\n
"
"aa______bbb_____cccc
\n
"
"aaa_____bbbb
\n
"
"aaa_____bbbb
\n
"
,
},
},
entry
{
entry
{
...
@@ -406,7 +406,7 @@ var tests = []entry {
...
@@ -406,7 +406,7 @@ var tests = []entry {
"------------------88888888
\n
"
"------------------88888888
\n
"
"
\n
"
"
\n
"
"666666-666666-666666----4444
\n
"
"666666-666666-666666----4444
\n
"
"1------1------999999999-0000000000
\n
"
"1------1------999999999-0000000000
\n
"
,
},
},
entry
{
entry
{
...
@@ -426,7 +426,7 @@ var tests = []entry {
...
@@ -426,7 +426,7 @@ var tests = []entry {
"....................88888888
\n
"
"....................88888888
\n
"
"
\n
"
"
\n
"
"666666...666666...666666......4444
\n
"
"666666...666666...666666......4444
\n
"
"1........1........999999999...0000000000
\n
"
"1........1........999999999...0000000000
\n
"
,
},
},
entry
{
entry
{
...
@@ -446,7 +446,7 @@ var tests = []entry {
...
@@ -446,7 +446,7 @@ var tests = []entry {
"
\t\t\t\t
88888888
\n
"
"
\t\t\t\t
88888888
\n
"
"
\n
"
"
\n
"
"666666
\t
666666
\t
666666
\t\t
4444
\n
"
"666666
\t
666666
\t
666666
\t\t
4444
\n
"
"1
\t
1
\t
<font color=red attr=日本語>999999999</font>
\t
0000000000
\n
"
"1
\t
1
\t
<font color=red attr=日本語>999999999</font>
\t
0000000000
\n
"
,
},
},
entry
{
entry
{
...
@@ -464,7 +464,7 @@ var tests = []entry {
...
@@ -464,7 +464,7 @@ var tests = []entry {
" 5.1 12.0 2.4 -7.0
\n
"
" 5.1 12.0 2.4 -7.0
\n
"
" .0 0.0 332.0 8908.0
\n
"
" .0 0.0 332.0 8908.0
\n
"
" .0 -.3 456.4 22.1
\n
"
" .0 -.3 456.4 22.1
\n
"
" .0 1.2 44.4 -13.3"
" .0 1.2 44.4 -13.3"
,
},
},
entry
{
entry
{
...
@@ -482,35 +482,35 @@ var tests = []entry {
...
@@ -482,35 +482,35 @@ var tests = []entry {
" 5.1| 12.0| 2.4| -7.0|
\n
"
" 5.1| 12.0| 2.4| -7.0|
\n
"
" .0| 0.0| 332.0| 8908.0|
\n
"
" .0| 0.0| 332.0| 8908.0|
\n
"
" .0| -.3| 456.4| 22.1|
\n
"
" .0| -.3| 456.4| 22.1|
\n
"
" .0| 1.2| 44.4| -13.3|"
" .0| 1.2| 44.4| -13.3|"
,
},
},
entry
{
entry
{
"15a"
,
"15a"
,
4
,
0
,
'.'
,
0
,
4
,
0
,
'.'
,
0
,
"a
\t\t
b"
,
"a
\t\t
b"
,
"a.......b"
"a.......b"
,
},
},
entry
{
entry
{
"15b"
,
"15b"
,
4
,
0
,
'.'
,
DiscardEmptyColumns
,
4
,
0
,
'.'
,
DiscardEmptyColumns
,
"a
\t\t
b"
,
// htabs - do not discard column
"a
\t\t
b"
,
// htabs - do not discard column
"a.......b"
"a.......b"
,
},
},
entry
{
entry
{
"15c"
,
"15c"
,
4
,
0
,
'.'
,
DiscardEmptyColumns
,
4
,
0
,
'.'
,
DiscardEmptyColumns
,
"a
\v\v
b"
,
"a
\v\v
b"
,
"a...b"
"a...b"
,
},
},
entry
{
entry
{
"15d"
,
"15d"
,
4
,
0
,
'.'
,
AlignRight
|
DiscardEmptyColumns
,
4
,
0
,
'.'
,
AlignRight
|
DiscardEmptyColumns
,
"a
\v\v
b"
,
"a
\v\v
b"
,
"...ab"
"...ab"
,
},
},
entry
{
entry
{
...
@@ -526,7 +526,7 @@ var tests = []entry {
...
@@ -526,7 +526,7 @@ var tests = []entry {
"a
\t
b
\t\t
d
\t
e
\n
"
"a
\t
b
\t\t
d
\t
e
\n
"
"a
\n
"
"a
\n
"
"a
\t
b
\t
c
\t
d
\n
"
"a
\t
b
\t
c
\t
d
\n
"
"a
\t
b
\t
c
\t
d
\t
e
\n
"
"a
\t
b
\t
c
\t
d
\t
e
\n
"
,
},
},
entry
{
entry
{
...
@@ -542,7 +542,7 @@ var tests = []entry {
...
@@ -542,7 +542,7 @@ var tests = []entry {
"a
\t
b
\t
d
\t
e
\n
"
"a
\t
b
\t
d
\t
e
\n
"
"a
\n
"
"a
\n
"
"a
\t
b
\t
c
\t
d
\n
"
"a
\t
b
\t
c
\t
d
\n
"
"a
\t
b
\t
c
\t
d
\t
e
\n
"
"a
\t
b
\t
c
\t
d
\t
e
\n
"
,
},
},
entry
{
entry
{
...
@@ -558,7 +558,7 @@ var tests = []entry {
...
@@ -558,7 +558,7 @@ var tests = []entry {
"a
\t
|b
\t
||d
\t
|e
\n
"
"a
\t
|b
\t
||d
\t
|e
\n
"
"a
\n
"
"a
\n
"
"a
\t
|b
\t
|c
\t
|d
\n
"
"a
\t
|b
\t
|c
\t
|d
\n
"
"a
\t
|b
\t
|c
\t
|d
\t
|e
\n
"
"a
\t
|b
\t
|c
\t
|d
\t
|e
\n
"
,
},
},
entry
{
entry
{
...
@@ -574,7 +574,7 @@ var tests = []entry {
...
@@ -574,7 +574,7 @@ var tests = []entry {
"a
\t
b
\t\t
d
\t
e
\n
"
"a
\t
b
\t\t
d
\t
e
\n
"
"a
\n
"
"a
\n
"
"a
\t
b
\t
c
\t
d
\n
"
"a
\t
b
\t
c
\t
d
\n
"
"a
\t
b
\t
c
\t
d
\t
e
\n
"
"a
\t
b
\t
c
\t
d
\t
e
\n
"
,
},
},
entry
{
entry
{
...
@@ -590,7 +590,7 @@ var tests = []entry {
...
@@ -590,7 +590,7 @@ var tests = []entry {
"a
\t
|b
\t
|
\t
|d
\t
|e
\n
"
"a
\t
|b
\t
|
\t
|d
\t
|e
\n
"
"a
\n
"
"a
\n
"
"a
\t
|b
\t
|c
\t
|d
\n
"
"a
\t
|b
\t
|c
\t
|d
\n
"
"a
\t
|b
\t
|c
\t
|d
\t
|e
\n
"
"a
\t
|b
\t
|c
\t
|d
\t
|e
\n
"
,
},
},
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment