-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update: pattern handling & add rust tests
- Loading branch information
1 parent
5bb7b8b
commit 934d91f
Showing
4 changed files
with
44 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
use leptos::*; | ||
use leptos_meta::*; | ||
|
||
#[component] | ||
fn App(cx: Scope) -> impl IntoView { | ||
let (count, set_count) = create_signal(cx, 0); | ||
provide_meta_context(cx); | ||
|
||
view! { cx, | ||
<Stylesheet id="leptos" href="/pkg/tailwind.css"/> | ||
<div class="container"> | ||
<button | ||
class="p-1 bg-sky-500 hover:bg-sky-700 text-white" | ||
class:rounded-lg=move || count() % 2 == 1 | ||
on:click=move |_| { | ||
set_count.update(|n| *n += 1); | ||
} | ||
> | ||
"Click me: " {move || count()} | ||
</button> | ||
</div> | ||
} | ||
} | ||
|
||
fn main() { | ||
leptos::mount_to_body(|cx| view! { cx, <App/> }) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
require("tests.queries.runner").test({ | ||
name = "rust", | ||
provider = "luapattern", | ||
file = "tests/queries/rust/leeptos.rs", | ||
ranges = { | ||
{ 10, 20, 10, 29 }, | ||
{ 12, 23, 12, 65 }, | ||
}, | ||
}) |