Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for dot imports #225

Merged
merged 2 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
19 changes: 19 additions & 0 deletions internal/import/import_test.go
Original file line number Diff line number Diff line change
@@ -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)
})
}
Loading