Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
e28692f0
Commit
e28692f0
authored
Jan 15, 2009
by
Robert Griesemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- converted tabwriter to new naming scheme
R=r OCL=22870 CL=22870
parent
f4babf69
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
96 additions
and
96 deletions
+96
-96
src/lib/tabwriter/tabwriter.go
src/lib/tabwriter/tabwriter.go
+49
-49
src/lib/tabwriter/tabwriter_test.go
src/lib/tabwriter/tabwriter_test.go
+47
-47
No files found.
src/lib/tabwriter/tabwriter.go
View file @
e28692f0
...
...
@@ -13,34 +13,34 @@ import (
// ----------------------------------------------------------------------------
// Basic
B
yteArray support
// Basic
b
yteArray support
type
B
yteArray
struct
{
type
b
yteArray
struct
{
a
[]
byte
;
}
func
(
b
*
B
yteArray
)
Init
(
initial_size
int
)
{
func
(
b
*
b
yteArray
)
Init
(
initial_size
int
)
{
b
.
a
=
make
([]
byte
,
initial_size
)[
0
:
0
];
}
func
(
b
*
B
yteArray
)
Len
()
int
{
func
(
b
*
b
yteArray
)
Len
()
int
{
return
len
(
b
.
a
);
}
func
(
b
*
ByteArray
)
C
lear
()
{
func
(
b
*
byteArray
)
c
lear
()
{
b
.
a
=
b
.
a
[
0
:
0
];
}
func
(
b
*
ByteArray
)
S
lice
(
i
,
j
int
)
[]
byte
{
func
(
b
*
byteArray
)
s
lice
(
i
,
j
int
)
[]
byte
{
return
b
.
a
[
i
:
j
];
// BUG should really be &b.a[i : j]
}
func
(
b
*
ByteArray
)
A
ppend
(
s
[]
byte
)
{
func
(
b
*
byteArray
)
a
ppend
(
s
[]
byte
)
{
a
:=
b
.
a
;
n
:=
len
(
a
);
m
:=
n
+
len
(
s
);
...
...
@@ -105,7 +105,7 @@ export type Writer struct {
// current state
html_char
byte
;
// terminating char of html tag/entity, or 0 ('>', ';', or 0)
buf
B
yteArray
;
// collected text w/o tabs and newlines
buf
b
yteArray
;
// collected text w/o tabs and newlines
size
int
;
// size of incomplete cell in bytes
width
int
;
// width of incomplete cell in runes up to buf[pos] w/o ignored sections
pos
int
;
// buffer position up to which width of incomplete cell has been computed
...
...
@@ -138,7 +138,7 @@ export type Writer struct {
// buf start of incomplete cell pos
func
(
b
*
Writer
)
A
ddLine
()
{
func
(
b
*
Writer
)
a
ddLine
()
{
b
.
lines_size
.
Push
(
array
.
NewIntArray
(
0
));
b
.
lines_width
.
Push
(
array
.
NewIntArray
(
0
));
}
...
...
@@ -164,13 +164,13 @@ func (b *Writer) Init(writer io.Write, cellwidth, padding int, padchar byte, ali
b
.
lines_size
.
Init
(
0
);
b
.
lines_width
.
Init
(
0
);
b
.
widths
.
Init
(
0
);
b
.
A
ddLine
();
// the very first line
b
.
a
ddLine
();
// the very first line
return
b
;
}
func
(
b
*
Writer
)
L
ine
(
i
int
)
(
*
array
.
IntArray
,
*
array
.
IntArray
)
{
func
(
b
*
Writer
)
l
ine
(
i
int
)
(
*
array
.
IntArray
,
*
array
.
IntArray
)
{
return
b
.
lines_size
.
At
(
i
)
.
(
*
array
.
IntArray
),
b
.
lines_width
.
At
(
i
)
.
(
*
array
.
IntArray
);
...
...
@@ -178,14 +178,14 @@ func (b *Writer) Line(i int) (*array.IntArray, *array.IntArray) {
// debugging support
func
(
b
*
Writer
)
D
ump
()
{
func
(
b
*
Writer
)
d
ump
()
{
pos
:=
0
;
for
i
:=
0
;
i
<
b
.
lines_size
.
Len
();
i
++
{
line_size
,
line_width
:=
b
.
L
ine
(
i
);
line_size
,
line_width
:=
b
.
l
ine
(
i
);
print
(
"("
,
i
,
") "
);
for
j
:=
0
;
j
<
line_size
.
Len
();
j
++
{
s
:=
line_size
.
At
(
j
);
print
(
"["
,
string
(
b
.
buf
.
S
lice
(
pos
,
pos
+
s
)),
"]"
);
print
(
"["
,
string
(
b
.
buf
.
s
lice
(
pos
,
pos
+
s
)),
"]"
);
pos
+=
s
;
}
print
(
"
\n
"
);
...
...
@@ -194,7 +194,7 @@ func (b *Writer) Dump() {
}
func
(
b
*
Writer
)
W
rite0
(
buf
[]
byte
)
*
os
.
Error
{
func
(
b
*
Writer
)
w
rite0
(
buf
[]
byte
)
*
os
.
Error
{
n
,
err
:=
b
.
writer
.
Write
(
buf
);
if
n
!=
len
(
buf
)
&&
err
==
nil
{
err
=
os
.
EIO
;
...
...
@@ -203,9 +203,9 @@ func (b *Writer) Write0(buf []byte) *os.Error {
}
var
N
ewline
=
[]
byte
{
'\n'
}
var
n
ewline
=
[]
byte
{
'\n'
}
func
(
b
*
Writer
)
W
ritePadding
(
textw
,
cellw
int
)
(
err
*
os
.
Error
)
{
func
(
b
*
Writer
)
w
ritePadding
(
textw
,
cellw
int
)
(
err
*
os
.
Error
)
{
if
b
.
padbytes
[
0
]
==
'\t'
{
// make cell width a multiple of cellwidth
cellw
=
((
cellw
+
b
.
cellwidth
-
1
)
/
b
.
cellwidth
)
*
b
.
cellwidth
;
...
...
@@ -221,34 +221,34 @@ func (b *Writer) WritePadding(textw, cellw int) (err *os.Error) {
}
for
n
>
len
(
b
.
padbytes
)
{
err
=
b
.
W
rite0
(
b
.
padbytes
);
err
=
b
.
w
rite0
(
b
.
padbytes
);
if
err
!=
nil
{
goto
exit
;
}
n
-=
len
(
b
.
padbytes
);
}
err
=
b
.
W
rite0
(
b
.
padbytes
[
0
:
n
]);
err
=
b
.
w
rite0
(
b
.
padbytes
[
0
:
n
]);
exit
:
return
err
;
}
func
(
b
*
Writer
)
W
riteLines
(
pos0
int
,
line0
,
line1
int
)
(
pos
int
,
err
*
os
.
Error
)
{
func
(
b
*
Writer
)
w
riteLines
(
pos0
int
,
line0
,
line1
int
)
(
pos
int
,
err
*
os
.
Error
)
{
pos
=
pos0
;
for
i
:=
line0
;
i
<
line1
;
i
++
{
line_size
,
line_width
:=
b
.
L
ine
(
i
);
line_size
,
line_width
:=
b
.
l
ine
(
i
);
for
j
:=
0
;
j
<
line_size
.
Len
();
j
++
{
s
,
w
:=
line_size
.
At
(
j
),
line_width
.
At
(
j
);
if
b
.
align_left
{
err
=
b
.
Write0
(
b
.
buf
.
S
lice
(
pos
,
pos
+
s
));
err
=
b
.
write0
(
b
.
buf
.
s
lice
(
pos
,
pos
+
s
));
if
err
!=
nil
{
goto
exit
;
}
pos
+=
s
;
if
j
<
b
.
widths
.
Len
()
{
err
=
b
.
W
ritePadding
(
w
,
b
.
widths
.
At
(
j
));
err
=
b
.
w
ritePadding
(
w
,
b
.
widths
.
At
(
j
));
if
err
!=
nil
{
goto
exit
;
}
...
...
@@ -257,12 +257,12 @@ func (b *Writer) WriteLines(pos0 int, line0, line1 int) (pos int, err *os.Error)
}
else
{
// align right
if
j
<
b
.
widths
.
Len
()
{
err
=
b
.
W
ritePadding
(
w
,
b
.
widths
.
At
(
j
));
err
=
b
.
w
ritePadding
(
w
,
b
.
widths
.
At
(
j
));
if
err
!=
nil
{
goto
exit
;
}
}
err
=
b
.
Write0
(
b
.
buf
.
S
lice
(
pos
,
pos
+
s
));
err
=
b
.
write0
(
b
.
buf
.
s
lice
(
pos
,
pos
+
s
));
if
err
!=
nil
{
goto
exit
;
}
...
...
@@ -273,11 +273,11 @@ func (b *Writer) WriteLines(pos0 int, line0, line1 int) (pos int, err *os.Error)
if
i
+
1
==
b
.
lines_size
.
Len
()
{
// last buffered line - we don't have a newline, so just write
// any outstanding buffered data
err
=
b
.
Write0
(
b
.
buf
.
S
lice
(
pos
,
pos
+
b
.
size
));
err
=
b
.
write0
(
b
.
buf
.
s
lice
(
pos
,
pos
+
b
.
size
));
pos
+=
b
.
size
;
}
else
{
// not the last line - write newline
err
=
b
.
Write0
(
N
ewline
);
err
=
b
.
write0
(
n
ewline
);
}
if
err
!=
nil
{
goto
exit
;
...
...
@@ -289,19 +289,19 @@ exit:
}
func
(
b
*
Writer
)
F
ormat
(
pos0
int
,
line0
,
line1
int
)
(
pos
int
,
err
*
os
.
Error
)
{
func
(
b
*
Writer
)
f
ormat
(
pos0
int
,
line0
,
line1
int
)
(
pos
int
,
err
*
os
.
Error
)
{
pos
=
pos0
;
column
:=
b
.
widths
.
Len
();
last
:=
line0
;
for
this
:=
line0
;
this
<
line1
;
this
++
{
line_size
,
line_width
:=
b
.
L
ine
(
this
);
line_size
,
line_width
:=
b
.
l
ine
(
this
);
if
column
<
line_size
.
Len
()
-
1
{
// cell exists in this column
// (note that the last cell per line is ignored)
// print unprinted lines until beginning of block
pos
,
err
=
b
.
W
riteLines
(
pos
,
last
,
this
);
pos
,
err
=
b
.
w
riteLines
(
pos
,
last
,
this
);
if
err
!=
nil
{
goto
exit
;
}
...
...
@@ -310,7 +310,7 @@ func (b *Writer) Format(pos0 int, line0, line1 int) (pos int, err *os.Error) {
// column block begin
width
:=
b
.
cellwidth
;
// minimal width
for
;
this
<
line1
;
this
++
{
line_size
,
line_width
=
b
.
L
ine
(
this
);
line_size
,
line_width
=
b
.
l
ine
(
this
);
if
column
<
line_size
.
Len
()
-
1
{
// cell exists in this column => update width
w
:=
line_width
.
At
(
column
)
+
b
.
padding
;
...
...
@@ -326,34 +326,34 @@ func (b *Writer) Format(pos0 int, line0, line1 int) (pos int, err *os.Error) {
// format and print all columns to the right of this column
// (we know the widths of this column and all columns to the left)
b
.
widths
.
Push
(
width
);
pos
,
err
=
b
.
F
ormat
(
pos
,
last
,
this
);
pos
,
err
=
b
.
f
ormat
(
pos
,
last
,
this
);
b
.
widths
.
Pop
();
last
=
this
;
}
}
// print unprinted lines until end
pos
,
err
=
b
.
W
riteLines
(
pos
,
last
,
line1
);
pos
,
err
=
b
.
w
riteLines
(
pos
,
last
,
line1
);
exit
:
return
pos
,
err
;
}
/* export */
func
(
b
*
Writer
)
Flush
()
*
os
.
Error
{
dummy
,
err
:=
b
.
F
ormat
(
0
,
0
,
b
.
lines_size
.
Len
());
func
(
b
*
Writer
)
Flush
()
*
os
.
Error
{
dummy
,
err
:=
b
.
f
ormat
(
0
,
0
,
b
.
lines_size
.
Len
());
// reset (even in the presence of errors)
b
.
buf
.
C
lear
();
b
.
buf
.
c
lear
();
b
.
size
,
b
.
width
=
0
,
0
;
b
.
pos
=
0
;
b
.
lines_size
.
Init
(
0
);
b
.
lines_width
.
Init
(
0
);
b
.
A
ddLine
();
b
.
a
ddLine
();
return
err
;
}
func
U
nicodeLen
(
buf
[]
byte
)
int
{
func
u
nicodeLen
(
buf
[]
byte
)
int
{
l
:=
0
;
for
i
:=
0
;
i
<
len
(
buf
);
{
if
buf
[
i
]
<
utf8
.
RuneSelf
{
...
...
@@ -368,8 +368,8 @@ func UnicodeLen(buf []byte) int {
}
func
(
b
*
Writer
)
A
ppend
(
buf
[]
byte
)
{
b
.
buf
.
A
ppend
(
buf
);
func
(
b
*
Writer
)
a
ppend
(
buf
[]
byte
)
{
b
.
buf
.
a
ppend
(
buf
);
b
.
size
+=
len
(
buf
);
}
...
...
@@ -385,23 +385,23 @@ func (b *Writer) Append(buf []byte) {
// outside html tag/entity
switch
ch
{
case
'\t'
,
'\n'
:
b
.
A
ppend
(
buf
[
i0
:
i
]);
b
.
a
ppend
(
buf
[
i0
:
i
]);
i0
=
i
+
1
;
// exclude ch from (next) cell
b
.
width
+=
UnicodeLen
(
b
.
buf
.
S
lice
(
b
.
pos
,
b
.
buf
.
Len
()));
b
.
width
+=
unicodeLen
(
b
.
buf
.
s
lice
(
b
.
pos
,
b
.
buf
.
Len
()));
b
.
pos
=
b
.
buf
.
Len
();
// terminate cell
last_size
,
last_width
:=
b
.
L
ine
(
b
.
lines_size
.
Len
()
-
1
);
last_size
,
last_width
:=
b
.
l
ine
(
b
.
lines_size
.
Len
()
-
1
);
last_size
.
Push
(
b
.
size
);
last_width
.
Push
(
b
.
width
);
b
.
size
,
b
.
width
=
0
,
0
;
if
ch
==
'\n'
{
b
.
A
ddLine
();
b
.
a
ddLine
();
if
last_size
.
Len
()
==
1
{
// The previous line has only one cell which does not have
// an impact on the formatting of the following lines (the
// last cell per line is ignored by
Format
), thus we can
// last cell per line is ignored by
format()
), thus we can
// flush the Writer contents.
err
=
b
.
Flush
();
if
err
!=
nil
{
...
...
@@ -412,9 +412,9 @@ func (b *Writer) Append(buf []byte) {
case
'<'
,
'&'
:
if
b
.
filter_html
{
b
.
A
ppend
(
buf
[
i0
:
i
]);
b
.
a
ppend
(
buf
[
i0
:
i
]);
i0
=
i
;
b
.
width
+=
UnicodeLen
(
b
.
buf
.
S
lice
(
b
.
pos
,
b
.
buf
.
Len
()));
b
.
width
+=
unicodeLen
(
b
.
buf
.
s
lice
(
b
.
pos
,
b
.
buf
.
Len
()));
b
.
pos
=
-
1
;
// preventative - should not be used (will cause index out of bounds)
if
ch
==
'<'
{
b
.
html_char
=
'>'
;
...
...
@@ -428,7 +428,7 @@ func (b *Writer) Append(buf []byte) {
// inside html tag/entity
if
ch
==
b
.
html_char
{
// reached the end of tag/entity
b
.
A
ppend
(
buf
[
i0
:
i
+
1
]);
b
.
a
ppend
(
buf
[
i0
:
i
+
1
]);
i0
=
i
+
1
;
if
b
.
html_char
==
';'
{
b
.
width
++
;
// count as one char
...
...
@@ -440,7 +440,7 @@ func (b *Writer) Append(buf []byte) {
}
// append leftover text
b
.
A
ppend
(
buf
[
i0
:
n
]);
b
.
a
ppend
(
buf
[
i0
:
n
]);
return
n
,
nil
;
}
...
...
src/lib/tabwriter/tabwriter_test.go
View file @
e28692f0
...
...
@@ -12,22 +12,22 @@ import (
)
type
B
uffer
struct
{
type
b
uffer
struct
{
a
[]
byte
;
}
func
(
b
*
Buffer
)
I
nit
(
n
int
)
{
func
(
b
*
buffer
)
i
nit
(
n
int
)
{
b
.
a
=
make
([]
byte
,
n
)[
0
:
0
];
}
func
(
b
*
Buffer
)
C
lear
()
{
func
(
b
*
buffer
)
c
lear
()
{
b
.
a
=
b
.
a
[
0
:
0
];
}
func
(
b
*
B
uffer
)
Write
(
buf
[]
byte
)
(
written
int
,
err
*
os
.
Error
)
{
func
(
b
*
b
uffer
)
Write
(
buf
[]
byte
)
(
written
int
,
err
*
os
.
Error
)
{
n
:=
len
(
b
.
a
);
m
:=
len
(
buf
);
if
n
+
m
<=
cap
(
b
.
a
)
{
...
...
@@ -42,12 +42,12 @@ func (b *Buffer) Write(buf []byte) (written int, err *os.Error) {
}
func
(
b
*
B
uffer
)
String
()
string
{
func
(
b
*
b
uffer
)
String
()
string
{
return
string
(
b
.
a
);
}
func
W
rite
(
t
*
testing
.
T
,
w
*
tabwriter
.
Writer
,
src
string
)
{
func
w
rite
(
t
*
testing
.
T
,
w
*
tabwriter
.
Writer
,
src
string
)
{
written
,
err
:=
io
.
WriteString
(
w
,
src
);
if
err
!=
nil
{
t
.
Errorf
(
"--- src:
\n
%s
\n
--- write error: %v
\n
"
,
src
,
err
);
...
...
@@ -58,7 +58,7 @@ func Write(t *testing.T, w *tabwriter.Writer, src string) {
}
func
Verify
(
t
*
testing
.
T
,
w
*
tabwriter
.
Writer
,
b
*
B
uffer
,
src
,
expected
string
)
{
func
verify
(
t
*
testing
.
T
,
w
*
tabwriter
.
Writer
,
b
*
b
uffer
,
src
,
expected
string
)
{
err
:=
w
.
Flush
();
if
err
!=
nil
{
t
.
Errorf
(
"--- src:
\n
%s
\n
--- flush error: %v
\n
"
,
src
,
err
);
...
...
@@ -71,142 +71,142 @@ func Verify(t *testing.T, w *tabwriter.Writer, b *Buffer, src, expected string)
}
func
C
heck
(
t
*
testing
.
T
,
tabwidth
,
padding
int
,
padchar
byte
,
align_left
,
filter_html
bool
,
src
,
expected
string
)
{
var
b
B
uffer
;
b
.
I
nit
(
1000
);
func
c
heck
(
t
*
testing
.
T
,
tabwidth
,
padding
int
,
padchar
byte
,
align_left
,
filter_html
bool
,
src
,
expected
string
)
{
var
b
b
uffer
;
b
.
i
nit
(
1000
);
var
w
tabwriter
.
Writer
;
w
.
Init
(
&
b
,
tabwidth
,
padding
,
padchar
,
align_left
,
filter_html
);
// write all at once
b
.
C
lear
();
W
rite
(
t
,
&
w
,
src
);
V
erify
(
t
,
&
w
,
&
b
,
src
,
expected
);
b
.
c
lear
();
w
rite
(
t
,
&
w
,
src
);
v
erify
(
t
,
&
w
,
&
b
,
src
,
expected
);
// write byte-by-byte
b
.
C
lear
();
b
.
c
lear
();
for
i
:=
0
;
i
<
len
(
src
);
i
++
{
W
rite
(
t
,
&
w
,
src
[
i
:
i
+
1
]);
w
rite
(
t
,
&
w
,
src
[
i
:
i
+
1
]);
}
V
erify
(
t
,
&
w
,
&
b
,
src
,
expected
);
v
erify
(
t
,
&
w
,
&
b
,
src
,
expected
);
// write using Fibonacci slice sizes
b
.
C
lear
();
b
.
c
lear
();
for
i
,
d
:=
0
,
0
;
i
<
len
(
src
);
{
W
rite
(
t
,
&
w
,
src
[
i
:
i
+
d
]);
w
rite
(
t
,
&
w
,
src
[
i
:
i
+
d
]);
i
,
d
=
i
+
d
,
d
+
1
;
if
i
+
d
>
len
(
src
)
{
d
=
len
(
src
)
-
i
;
}
}
V
erify
(
t
,
&
w
,
&
b
,
src
,
expected
);
v
erify
(
t
,
&
w
,
&
b
,
src
,
expected
);
}
export
func
Test
(
t
*
testing
.
T
)
{
C
heck
(
c
heck
(
t
,
8
,
1
,
'.'
,
true
,
false
,
""
,
""
);
C
heck
(
c
heck
(
t
,
8
,
1
,
'.'
,
true
,
false
,
"
\n\n\n
"
,
"
\n\n\n
"
);
C
heck
(
c
heck
(
t
,
8
,
1
,
'.'
,
true
,
false
,
"a
\n
b
\n
c"
,
"a
\n
b
\n
c"
);
C
heck
(
c
heck
(
t
,
8
,
1
,
'.'
,
true
,
false
,
"
\t
"
,
// '\t' terminates an empty cell on last line - nothing to print
""
);
C
heck
(
c
heck
(
t
,
8
,
1
,
'.'
,
false
,
false
,
"
\t
"
,
// '\t' terminates an empty cell on last line - nothing to print
""
);
C
heck
(
c
heck
(
t
,
8
,
1
,
'.'
,
true
,
false
,
"*
\t
*"
,
"**"
);
C
heck
(
c
heck
(
t
,
8
,
1
,
'.'
,
true
,
false
,
"*
\t
*
\n
"
,
"*.......*
\n
"
);
C
heck
(
c
heck
(
t
,
8
,
1
,
'.'
,
true
,
false
,
"*
\t
*
\t
"
,
"*.......*"
);
C
heck
(
c
heck
(
t
,
8
,
1
,
'.'
,
false
,
false
,
"*
\t
*
\t
"
,
".......**"
);
C
heck
(
c
heck
(
t
,
8
,
1
,
'.'
,
true
,
false
,
"
\t\n
"
,
"........
\n
"
);
C
heck
(
c
heck
(
t
,
8
,
1
,
'.'
,
true
,
false
,
"a) foo"
,
"a) foo"
);
C
heck
(
c
heck
(
t
,
8
,
1
,
' '
,
true
,
false
,
"b) foo
\t
bar"
,
// "bar" is not in any cell - not formatted, just flushed
"b) foobar"
);
C
heck
(
c
heck
(
t
,
8
,
1
,
'.'
,
true
,
false
,
"c) foo
\t
bar
\t
"
,
"c) foo..bar"
);
C
heck
(
c
heck
(
t
,
8
,
1
,
'.'
,
true
,
false
,
"d) foo
\t
bar
\n
"
,
"d) foo..bar
\n
"
);
C
heck
(
c
heck
(
t
,
8
,
1
,
'.'
,
true
,
false
,
"e) foo
\t
bar
\t\n
"
,
"e) foo..bar.....
\n
"
);
C
heck
(
c
heck
(
t
,
8
,
1
,
'.'
,
true
,
true
,
"e) f<o
\t
<b>bar</b>
\t\n
"
,
"e) f<o..<b>bar</b>.....
\n
"
);
C
heck
(
c
heck
(
t
,
8
,
1
,
'*'
,
true
,
false
,
"Hello, world!
\n
"
,
"Hello, world!
\n
"
);
C
heck
(
c
heck
(
t
,
0
,
0
,
'.'
,
true
,
false
,
"1
\t
2
\t
3
\t
4
\n
"
"11
\t
222
\t
3333
\t
44444
\n
"
,
...
...
@@ -215,19 +215,19 @@ export func Test(t *testing.T) {
"11222333344444
\n
"
);
C
heck
(
c
heck
(
t
,
5
,
0
,
'.'
,
true
,
false
,
"1
\t
2
\t
3
\t
4
\n
"
,
"1....2....3....4
\n
"
);
C
heck
(
c
heck
(
t
,
5
,
0
,
'.'
,
true
,
false
,
"1
\t
2
\t
3
\t
4
\t\n
"
,
"1....2....3....4....
\n
"
);
C
heck
(
c
heck
(
t
,
8
,
1
,
'.'
,
true
,
false
,
"本
\t
b
\t
c
\n
"
"aa
\t\u672c\u672c\u672c\t
cccc
\t
ddddd
\n
"
...
...
@@ -238,7 +238,7 @@ export func Test(t *testing.T) {
"aaa.....bbbb
\n
"
);
C
heck
(
c
heck
(
t
,
8
,
1
,
' '
,
false
,
false
,
"a
\t
è
\t
c
\t\n
"
"aa
\t
èèè
\t
cccc
\t
ddddd
\t\n
"
...
...
@@ -249,7 +249,7 @@ export func Test(t *testing.T) {
" aaa èèèè
\n
"
);
C
heck
(
c
heck
(
t
,
2
,
0
,
' '
,
true
,
false
,
"a
\t
b
\t
c
\n
"
"aa
\t
bbb
\t
cccc
\n
"
...
...
@@ -260,7 +260,7 @@ export func Test(t *testing.T) {
"aaabbbb
\n
"
);
C
heck
(
c
heck
(
t
,
8
,
1
,
'_'
,
true
,
false
,
"a
\t
b
\t
c
\n
"
"aa
\t
bbb
\t
cccc
\n
"
...
...
@@ -271,7 +271,7 @@ export func Test(t *testing.T) {
"aaa_____bbbb
\n
"
);
C
heck
(
c
heck
(
t
,
4
,
1
,
'-'
,
true
,
false
,
"4444
\t
日本語
\t
22
\t
1
\t
333
\n
"
"999999999
\t
22
\n
"
...
...
@@ -290,7 +290,7 @@ export func Test(t *testing.T) {
"1------1------999999999-0000000000
\n
"
);
C
heck
(
c
heck
(
t
,
4
,
3
,
'.'
,
true
,
false
,
"4444
\t
333
\t
22
\t
1
\t
333
\n
"
"999999999
\t
22
\n
"
...
...
@@ -309,7 +309,7 @@ export func Test(t *testing.T) {
"1........1........999999999...0000000000
\n
"
);
C
heck
(
c
heck
(
t
,
8
,
1
,
'\t'
,
true
,
true
,
"4444
\t
333
\t
22
\t
1
\t
333
\n
"
"999999999
\t
22
\n
"
...
...
@@ -328,7 +328,7 @@ export func Test(t *testing.T) {
"1
\t
1
\t
<font color=red attr=日本語>999999999</font>
\t
0000000000
\n
"
);
C
heck
(
c
heck
(
t
,
0
,
2
,
' '
,
false
,
false
,
".0
\t
.3
\t
2.4
\t
-5.1
\t\n
"
"23.0
\t
12345678.9
\t
2.4
\t
-989.4
\t\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