We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e800742 commit b75d2a6Copy full SHA for b75d2a6
headerfinder_test.go
@@ -5,6 +5,7 @@ import (
5
6
"github.com/stretchr/testify/assert"
7
"golang.org/x/net/html"
8
+ "golang.org/x/net/html/atom"
9
)
10
11
const singleH1 = `
@@ -98,3 +99,13 @@ func TestFindAttribute(t *testing.T) {
98
99
assert.False(t, ok)
100
})
101
}
102
+
103
+func TestGetHxDepth(t *testing.T) {
104
+ assert.Equal(t, HxDepth(0), getHxDepth(atom.H1))
105
+ assert.Equal(t, HxDepth(1), getHxDepth(atom.H2))
106
+ assert.Equal(t, HxDepth(2), getHxDepth(atom.H3))
107
+ assert.Equal(t, HxDepth(3), getHxDepth(atom.H4))
108
+ assert.Equal(t, HxDepth(4), getHxDepth(atom.H5))
109
+ assert.Equal(t, HxDepth(5), getHxDepth(atom.H6))
110
+ assert.Equal(t, InvalidDepth, getHxDepth(atom.A))
111
+}
0 commit comments