Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
b563bb37
Commit
b563bb37
authored
Jul 17, 2015
by
Daniel Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix unversioned test
parent
f7873d2a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
unversioned_warning.go
cmd/mungedocs/unversioned_warning.go
+5
-1
unversioned_warning_test.go
cmd/mungedocs/unversioned_warning_test.go
+1
-1
No files found.
cmd/mungedocs/unversioned_warning.go
View file @
b563bb37
...
@@ -54,6 +54,10 @@ Documentation for other releases can be found at
...
@@ -54,6 +54,10 @@ Documentation for other releases can be found at
<!-- END STRIP_FOR_RELEASE -->
<!-- END STRIP_FOR_RELEASE -->
`
`
func
makeUnversionedWarning
(
fileName
string
)
string
{
return
fmt
.
Sprintf
(
unversionedWarningFmt
,
fileName
)
}
// inserts/updates a warning for unversioned docs
// inserts/updates a warning for unversioned docs
func
updateUnversionedWarning
(
file
string
,
markdown
[]
byte
)
([]
byte
,
error
)
{
func
updateUnversionedWarning
(
file
string
,
markdown
[]
byte
)
([]
byte
,
error
)
{
lines
:=
splitLines
(
markdown
)
lines
:=
splitLines
(
markdown
)
...
@@ -64,5 +68,5 @@ func updateUnversionedWarning(file string, markdown []byte) ([]byte, error) {
...
@@ -64,5 +68,5 @@ func updateUnversionedWarning(file string, markdown []byte) ([]byte, error) {
if
!
hasMacroBlock
(
lines
,
beginUnversionedWarning
,
endUnversionedWarning
)
{
if
!
hasMacroBlock
(
lines
,
beginUnversionedWarning
,
endUnversionedWarning
)
{
lines
=
append
([]
string
{
beginUnversionedWarning
,
endUnversionedWarning
},
lines
...
)
lines
=
append
([]
string
{
beginUnversionedWarning
,
endUnversionedWarning
},
lines
...
)
}
}
return
updateMacroBlock
(
lines
,
beginUnversionedWarning
,
endUnversionedWarning
,
fmt
.
Sprintf
(
unversionedWarningFmt
,
file
))
return
updateMacroBlock
(
lines
,
beginUnversionedWarning
,
endUnversionedWarning
,
makeUnversionedWarning
(
file
))
}
}
cmd/mungedocs/unversioned_warning_test.go
View file @
b563bb37
...
@@ -23,7 +23,7 @@ import (
...
@@ -23,7 +23,7 @@ import (
)
)
func
TestUnversionedWarning
(
t
*
testing
.
T
)
{
func
TestUnversionedWarning
(
t
*
testing
.
T
)
{
warningBlock
:=
beginUnversionedWarning
+
"
\n
"
+
unversionedWarning
+
"
\n
"
+
endUnversionedWarning
+
"
\n
"
warningBlock
:=
beginUnversionedWarning
+
"
\n
"
+
makeUnversionedWarning
(
"filename.md"
)
+
"
\n
"
+
endUnversionedWarning
+
"
\n
"
var
cases
=
[]
struct
{
var
cases
=
[]
struct
{
in
string
in
string
out
string
out
string
...
...
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