Skip to content

Commit e800742

Browse files
committed
Implemented missing test
1 parent a7882eb commit e800742

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

headerfinder.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,16 @@ func findHeaders(r io.Reader) []Header {
4848
}
4949

5050
func getHxDepth(dataAtom atom.Atom) HxDepth {
51-
depths := []atom.Atom{
51+
hxAtoms := []atom.Atom{
5252
atom.H1,
5353
atom.H2,
5454
atom.H3,
5555
atom.H4,
5656
atom.H5,
5757
atom.H6,
5858
}
59-
for depth, v := range depths {
60-
if dataAtom == v {
59+
for depth, hxAtom := range hxAtoms {
60+
if dataAtom == hxAtom {
6161
return HxDepth(depth)
6262
}
6363
}

headerfinder_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ func TestFindAttribute(t *testing.T) {
9494
assert.Equal(t, spaceGreeting, attr)
9595
})
9696
t.Run("attribute does not exist", func(t *testing.T) {
97-
t.Error("IMPLEMENT ME!")
97+
_, ok := findAttribute(attrs, "", "doesnotexist")
98+
assert.False(t, ok)
9899
})
99100
}

0 commit comments

Comments
 (0)