about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMarkus Wüstenberg2024-10-11 10:37:23 +0200
committerGitHub2024-10-11 08:37:23 +0000
commit853044729768d3a52d1aba5c9e081737a5088b11 (patch)
tree1237f2898c34ebc9e979e415b24c5d84257cd454
parent05d56605492cb89bebd80421a6d2afaa947344f0 (diff)
downloadgomponents-853044729768d3a52d1aba5c9e081737a5088b11.tar.lz
gomponents-853044729768d3a52d1aba5c9e081737a5088b11.tar.zst
gomponents-853044729768d3a52d1aba5c9e081737a5088b11.zip
Add test for dot imports (#225)
So we can be sure all dot imports work at the same time.
-rw-r--r--README.md4
-rw-r--r--internal/import/import_test.go19
2 files changed, 21 insertions, 2 deletions
diff --git a/README.md b/README.md
index 0782c10..b4c5f85 100644
--- a/README.md
+++ b/README.md
@@ -70,13 +70,13 @@ func NavbarLink(href, name, currentPath string) Node {
 }
 ```
 
-Some people don't like dot-imports, and luckily it's completely optional.
+(Some people don't like dot-imports, and luckily it's completely optional.)
 
 For a more complete example, see [the examples directory](internal/examples/).
 
 ### What's up with the specially named elements and attributes?
 
-Unfortunately, there are six main name clashes in HTML elements and attributes, so they need an `El` or `Attr` suffix,
+Unfortunately, there are some name clashes in HTML elements and attributes, so they need an `El` or `Attr` suffix,
 to be able to co-exist in the same package in Go.
 
 I've chosen one or the other based on what I think is the common usage.
diff --git a/internal/import/import_test.go b/internal/import/import_test.go
new file mode 100644
index 0000000..e505e46
--- /dev/null
+++ b/internal/import/import_test.go
@@ -0,0 +1,19 @@
+package import_test
+
+import (
+	"testing"
+
+	. "maragu.dev/gomponents"
+	. "maragu.dev/gomponents/components"
+	. "maragu.dev/gomponents/html"
+	. "maragu.dev/gomponents/http"
+)
+
+func TestImports(t *testing.T) {
+	t.Run("this is just a test that does nothing, but I need the dot imports above", func(t *testing.T) {
+		_ = El("div")
+		_ = A()
+		_ = HTML5(HTML5Props{})
+		_ = Adapt(nil)
+	})
+}