Skip to content

Commit

Permalink
Add failing example.
Browse files Browse the repository at this point in the history
  • Loading branch information
kaj committed Jul 18, 2023
1 parent 8db7d10 commit 1e8ff0d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions examples/simple/src/main.rs
Expand Up @@ -338,3 +338,11 @@ fn lifetimes2() {
"\n <p>foo</p>\n\n <p>bar</p>\n\n",
);
}

#[test]
fn test_list_join() {
assert_eq!(
r2s(|o| list_joins_html(o, &[2, 3, 7])),
"<p>Items: 2, 3, 7.</p>\n",
)
}
6 changes: 6 additions & 0 deletions examples/simple/templates/list_joins.rs.html
@@ -0,0 +1,6 @@
@use super::{number_item_html, JoinHtml, JoinToHtml};

@(items: &[u8])

<p>Items: @items.iter().join_to_html(", ").</p>
<p>Items: @items.iter().cloned().join_html(number_item_html, ", ").</p>
2 changes: 2 additions & 0 deletions examples/simple/templates/number_item.rs.html
@@ -0,0 +1,2 @@
@(item: u8)
#@item

0 comments on commit 1e8ff0d

Please sign in to comment.