hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit f69df916df341671d602fcc4f2604838b1ea72ec
parent 690b0f8ff5795318dfa3834a5a75d6623e7d934a
Author: Cameron Moore <moorereason@gmail.com>
Date:   Mon,  1 May 2017 09:13:21 -0500

tpl: Add basic tests for all namespace init funcs

Diffstat:
Atpl/cast/init_test.go | 38++++++++++++++++++++++++++++++++++++++
Atpl/collections/init_test.go | 38++++++++++++++++++++++++++++++++++++++
Atpl/compare/init_test.go | 38++++++++++++++++++++++++++++++++++++++
Atpl/crypto/init_test.go | 38++++++++++++++++++++++++++++++++++++++
Atpl/data/init_test.go | 38++++++++++++++++++++++++++++++++++++++
Atpl/encoding/init_test.go | 38++++++++++++++++++++++++++++++++++++++
Atpl/fmt/init_test.go | 38++++++++++++++++++++++++++++++++++++++
Atpl/images/init_test.go | 38++++++++++++++++++++++++++++++++++++++
Atpl/inflect/init_test.go | 38++++++++++++++++++++++++++++++++++++++
Atpl/lang/init_test.go | 38++++++++++++++++++++++++++++++++++++++
Atpl/math/init_test.go | 38++++++++++++++++++++++++++++++++++++++
Atpl/os/init_test.go | 38++++++++++++++++++++++++++++++++++++++
Atpl/partials/init_test.go | 38++++++++++++++++++++++++++++++++++++++
Atpl/safe/init_test.go | 38++++++++++++++++++++++++++++++++++++++
Atpl/strings/init_test.go | 38++++++++++++++++++++++++++++++++++++++
Atpl/time/init_test.go | 38++++++++++++++++++++++++++++++++++++++
Atpl/transform/init_test.go | 38++++++++++++++++++++++++++++++++++++++
Atpl/urls/init_test.go | 38++++++++++++++++++++++++++++++++++++++
18 files changed, 684 insertions(+), 0 deletions(-)
diff --git a/tpl/cast/init_test.go b/tpl/cast/init_test.go
@@ -0,0 +1,38 @@
+// Copyright 2017 The Hugo Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package cast
+
+import (
+	"testing"
+
+	"github.com/spf13/hugo/deps"
+	"github.com/spf13/hugo/tpl/internal"
+	"github.com/stretchr/testify/require"
+)
+
+func TestInit(t *testing.T) {
+	var found bool
+	var ns *internal.TemplateFuncsNamespace
+
+	for _, nsf := range internal.TemplateFuncsNamespaceRegistry {
+		ns = nsf(&deps.Deps{})
+		if ns.Name == name {
+			found = true
+			break
+		}
+	}
+
+	require.True(t, found)
+	require.IsType(t, &Namespace{}, ns.Context.(func() interface{})())
+}
diff --git a/tpl/collections/init_test.go b/tpl/collections/init_test.go
@@ -0,0 +1,38 @@
+// Copyright 2017 The Hugo Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package collections
+
+import (
+	"testing"
+
+	"github.com/spf13/hugo/deps"
+	"github.com/spf13/hugo/tpl/internal"
+	"github.com/stretchr/testify/require"
+)
+
+func TestInit(t *testing.T) {
+	var found bool
+	var ns *internal.TemplateFuncsNamespace
+
+	for _, nsf := range internal.TemplateFuncsNamespaceRegistry {
+		ns = nsf(&deps.Deps{})
+		if ns.Name == name {
+			found = true
+			break
+		}
+	}
+
+	require.True(t, found)
+	require.IsType(t, &Namespace{}, ns.Context.(func() interface{})())
+}
diff --git a/tpl/compare/init_test.go b/tpl/compare/init_test.go
@@ -0,0 +1,38 @@
+// Copyright 2017 The Hugo Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package compare
+
+import (
+	"testing"
+
+	"github.com/spf13/hugo/deps"
+	"github.com/spf13/hugo/tpl/internal"
+	"github.com/stretchr/testify/require"
+)
+
+func TestInit(t *testing.T) {
+	var found bool
+	var ns *internal.TemplateFuncsNamespace
+
+	for _, nsf := range internal.TemplateFuncsNamespaceRegistry {
+		ns = nsf(&deps.Deps{})
+		if ns.Name == name {
+			found = true
+			break
+		}
+	}
+
+	require.True(t, found)
+	require.IsType(t, &Namespace{}, ns.Context.(func() interface{})())
+}
diff --git a/tpl/crypto/init_test.go b/tpl/crypto/init_test.go
@@ -0,0 +1,38 @@
+// Copyright 2017 The Hugo Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package crypto
+
+import (
+	"testing"
+
+	"github.com/spf13/hugo/deps"
+	"github.com/spf13/hugo/tpl/internal"
+	"github.com/stretchr/testify/require"
+)
+
+func TestInit(t *testing.T) {
+	var found bool
+	var ns *internal.TemplateFuncsNamespace
+
+	for _, nsf := range internal.TemplateFuncsNamespaceRegistry {
+		ns = nsf(&deps.Deps{})
+		if ns.Name == name {
+			found = true
+			break
+		}
+	}
+
+	require.True(t, found)
+	require.IsType(t, &Namespace{}, ns.Context.(func() interface{})())
+}
diff --git a/tpl/data/init_test.go b/tpl/data/init_test.go
@@ -0,0 +1,38 @@
+// Copyright 2017 The Hugo Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package data
+
+import (
+	"testing"
+
+	"github.com/spf13/hugo/deps"
+	"github.com/spf13/hugo/tpl/internal"
+	"github.com/stretchr/testify/require"
+)
+
+func TestInit(t *testing.T) {
+	var found bool
+	var ns *internal.TemplateFuncsNamespace
+
+	for _, nsf := range internal.TemplateFuncsNamespaceRegistry {
+		ns = nsf(&deps.Deps{})
+		if ns.Name == name {
+			found = true
+			break
+		}
+	}
+
+	require.True(t, found)
+	require.IsType(t, &Namespace{}, ns.Context.(func() interface{})())
+}
diff --git a/tpl/encoding/init_test.go b/tpl/encoding/init_test.go
@@ -0,0 +1,38 @@
+// Copyright 2017 The Hugo Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package encoding
+
+import (
+	"testing"
+
+	"github.com/spf13/hugo/deps"
+	"github.com/spf13/hugo/tpl/internal"
+	"github.com/stretchr/testify/require"
+)
+
+func TestInit(t *testing.T) {
+	var found bool
+	var ns *internal.TemplateFuncsNamespace
+
+	for _, nsf := range internal.TemplateFuncsNamespaceRegistry {
+		ns = nsf(&deps.Deps{})
+		if ns.Name == name {
+			found = true
+			break
+		}
+	}
+
+	require.True(t, found)
+	require.IsType(t, &Namespace{}, ns.Context.(func() interface{})())
+}
diff --git a/tpl/fmt/init_test.go b/tpl/fmt/init_test.go
@@ -0,0 +1,38 @@
+// Copyright 2017 The Hugo Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package fmt
+
+import (
+	"testing"
+
+	"github.com/spf13/hugo/deps"
+	"github.com/spf13/hugo/tpl/internal"
+	"github.com/stretchr/testify/require"
+)
+
+func TestInit(t *testing.T) {
+	var found bool
+	var ns *internal.TemplateFuncsNamespace
+
+	for _, nsf := range internal.TemplateFuncsNamespaceRegistry {
+		ns = nsf(&deps.Deps{})
+		if ns.Name == name {
+			found = true
+			break
+		}
+	}
+
+	require.True(t, found)
+	require.IsType(t, &Namespace{}, ns.Context.(func() interface{})())
+}
diff --git a/tpl/images/init_test.go b/tpl/images/init_test.go
@@ -0,0 +1,38 @@
+// Copyright 2017 The Hugo Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package images
+
+import (
+	"testing"
+
+	"github.com/spf13/hugo/deps"
+	"github.com/spf13/hugo/tpl/internal"
+	"github.com/stretchr/testify/require"
+)
+
+func TestInit(t *testing.T) {
+	var found bool
+	var ns *internal.TemplateFuncsNamespace
+
+	for _, nsf := range internal.TemplateFuncsNamespaceRegistry {
+		ns = nsf(&deps.Deps{})
+		if ns.Name == name {
+			found = true
+			break
+		}
+	}
+
+	require.True(t, found)
+	require.IsType(t, &Namespace{}, ns.Context.(func() interface{})())
+}
diff --git a/tpl/inflect/init_test.go b/tpl/inflect/init_test.go
@@ -0,0 +1,38 @@
+// Copyright 2017 The Hugo Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package inflect
+
+import (
+	"testing"
+
+	"github.com/spf13/hugo/deps"
+	"github.com/spf13/hugo/tpl/internal"
+	"github.com/stretchr/testify/require"
+)
+
+func TestInit(t *testing.T) {
+	var found bool
+	var ns *internal.TemplateFuncsNamespace
+
+	for _, nsf := range internal.TemplateFuncsNamespaceRegistry {
+		ns = nsf(&deps.Deps{})
+		if ns.Name == name {
+			found = true
+			break
+		}
+	}
+
+	require.True(t, found)
+	require.IsType(t, &Namespace{}, ns.Context.(func() interface{})())
+}
diff --git a/tpl/lang/init_test.go b/tpl/lang/init_test.go
@@ -0,0 +1,38 @@
+// Copyright 2017 The Hugo Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package lang
+
+import (
+	"testing"
+
+	"github.com/spf13/hugo/deps"
+	"github.com/spf13/hugo/tpl/internal"
+	"github.com/stretchr/testify/require"
+)
+
+func TestInit(t *testing.T) {
+	var found bool
+	var ns *internal.TemplateFuncsNamespace
+
+	for _, nsf := range internal.TemplateFuncsNamespaceRegistry {
+		ns = nsf(&deps.Deps{})
+		if ns.Name == name {
+			found = true
+			break
+		}
+	}
+
+	require.True(t, found)
+	require.IsType(t, &Namespace{}, ns.Context.(func() interface{})())
+}
diff --git a/tpl/math/init_test.go b/tpl/math/init_test.go
@@ -0,0 +1,38 @@
+// Copyright 2017 The Hugo Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package math
+
+import (
+	"testing"
+
+	"github.com/spf13/hugo/deps"
+	"github.com/spf13/hugo/tpl/internal"
+	"github.com/stretchr/testify/require"
+)
+
+func TestInit(t *testing.T) {
+	var found bool
+	var ns *internal.TemplateFuncsNamespace
+
+	for _, nsf := range internal.TemplateFuncsNamespaceRegistry {
+		ns = nsf(&deps.Deps{})
+		if ns.Name == name {
+			found = true
+			break
+		}
+	}
+
+	require.True(t, found)
+	require.IsType(t, &Namespace{}, ns.Context.(func() interface{})())
+}
diff --git a/tpl/os/init_test.go b/tpl/os/init_test.go
@@ -0,0 +1,38 @@
+// Copyright 2017 The Hugo Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package os
+
+import (
+	"testing"
+
+	"github.com/spf13/hugo/deps"
+	"github.com/spf13/hugo/tpl/internal"
+	"github.com/stretchr/testify/require"
+)
+
+func TestInit(t *testing.T) {
+	var found bool
+	var ns *internal.TemplateFuncsNamespace
+
+	for _, nsf := range internal.TemplateFuncsNamespaceRegistry {
+		ns = nsf(&deps.Deps{})
+		if ns.Name == name {
+			found = true
+			break
+		}
+	}
+
+	require.True(t, found)
+	require.IsType(t, &Namespace{}, ns.Context.(func() interface{})())
+}
diff --git a/tpl/partials/init_test.go b/tpl/partials/init_test.go
@@ -0,0 +1,38 @@
+// Copyright 2017 The Hugo Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package partials
+
+import (
+	"testing"
+
+	"github.com/spf13/hugo/deps"
+	"github.com/spf13/hugo/tpl/internal"
+	"github.com/stretchr/testify/require"
+)
+
+func TestInit(t *testing.T) {
+	var found bool
+	var ns *internal.TemplateFuncsNamespace
+
+	for _, nsf := range internal.TemplateFuncsNamespaceRegistry {
+		ns = nsf(&deps.Deps{})
+		if ns.Name == name {
+			found = true
+			break
+		}
+	}
+
+	require.True(t, found)
+	require.IsType(t, &Namespace{}, ns.Context.(func() interface{})())
+}
diff --git a/tpl/safe/init_test.go b/tpl/safe/init_test.go
@@ -0,0 +1,38 @@
+// Copyright 2017 The Hugo Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package safe
+
+import (
+	"testing"
+
+	"github.com/spf13/hugo/deps"
+	"github.com/spf13/hugo/tpl/internal"
+	"github.com/stretchr/testify/require"
+)
+
+func TestInit(t *testing.T) {
+	var found bool
+	var ns *internal.TemplateFuncsNamespace
+
+	for _, nsf := range internal.TemplateFuncsNamespaceRegistry {
+		ns = nsf(&deps.Deps{})
+		if ns.Name == name {
+			found = true
+			break
+		}
+	}
+
+	require.True(t, found)
+	require.IsType(t, &Namespace{}, ns.Context.(func() interface{})())
+}
diff --git a/tpl/strings/init_test.go b/tpl/strings/init_test.go
@@ -0,0 +1,38 @@
+// Copyright 2017 The Hugo Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package strings
+
+import (
+	"testing"
+
+	"github.com/spf13/hugo/deps"
+	"github.com/spf13/hugo/tpl/internal"
+	"github.com/stretchr/testify/require"
+)
+
+func TestInit(t *testing.T) {
+	var found bool
+	var ns *internal.TemplateFuncsNamespace
+
+	for _, nsf := range internal.TemplateFuncsNamespaceRegistry {
+		ns = nsf(&deps.Deps{})
+		if ns.Name == name {
+			found = true
+			break
+		}
+	}
+
+	require.True(t, found)
+	require.IsType(t, &Namespace{}, ns.Context.(func() interface{})())
+}
diff --git a/tpl/time/init_test.go b/tpl/time/init_test.go
@@ -0,0 +1,38 @@
+// Copyright 2017 The Hugo Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package time
+
+import (
+	"testing"
+
+	"github.com/spf13/hugo/deps"
+	"github.com/spf13/hugo/tpl/internal"
+	"github.com/stretchr/testify/require"
+)
+
+func TestInit(t *testing.T) {
+	var found bool
+	var ns *internal.TemplateFuncsNamespace
+
+	for _, nsf := range internal.TemplateFuncsNamespaceRegistry {
+		ns = nsf(&deps.Deps{})
+		if ns.Name == name {
+			found = true
+			break
+		}
+	}
+
+	require.True(t, found)
+	require.IsType(t, &Namespace{}, ns.Context.(func() interface{})())
+}
diff --git a/tpl/transform/init_test.go b/tpl/transform/init_test.go
@@ -0,0 +1,38 @@
+// Copyright 2017 The Hugo Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package transform
+
+import (
+	"testing"
+
+	"github.com/spf13/hugo/deps"
+	"github.com/spf13/hugo/tpl/internal"
+	"github.com/stretchr/testify/require"
+)
+
+func TestInit(t *testing.T) {
+	var found bool
+	var ns *internal.TemplateFuncsNamespace
+
+	for _, nsf := range internal.TemplateFuncsNamespaceRegistry {
+		ns = nsf(&deps.Deps{})
+		if ns.Name == name {
+			found = true
+			break
+		}
+	}
+
+	require.True(t, found)
+	require.IsType(t, &Namespace{}, ns.Context.(func() interface{})())
+}
diff --git a/tpl/urls/init_test.go b/tpl/urls/init_test.go
@@ -0,0 +1,38 @@
+// Copyright 2017 The Hugo Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package urls
+
+import (
+	"testing"
+
+	"github.com/spf13/hugo/deps"
+	"github.com/spf13/hugo/tpl/internal"
+	"github.com/stretchr/testify/require"
+)
+
+func TestInit(t *testing.T) {
+	var found bool
+	var ns *internal.TemplateFuncsNamespace
+
+	for _, nsf := range internal.TemplateFuncsNamespaceRegistry {
+		ns = nsf(&deps.Deps{})
+		if ns.Name == name {
+			found = true
+			break
+		}
+	}
+
+	require.True(t, found)
+	require.IsType(t, &Namespace{}, ns.Context.(func() interface{})())
+}