[ { "name": "div_simple", "sx_input": "(div \"hello\")", "expected_html": "
hello
" }, { "name": "div_class", "sx_input": "(div :class \"card\" \"content\")", "expected_html": "
content
" }, { "name": "p_text", "sx_input": "(p \"paragraph text\")", "expected_html": "

paragraph text

" }, { "name": "nested_tags", "sx_input": "(div (p \"a\") (p \"b\"))", "expected_html": "

a

b

" }, { "name": "void_br", "sx_input": "(br)", "expected_html": "
" }, { "name": "void_hr", "sx_input": "(hr)", "expected_html": "
" }, { "name": "void_img", "sx_input": "(img :src \"/photo.jpg\" :alt \"A photo\")", "expected_html": "\"A" }, { "name": "void_input", "sx_input": "(input :type \"text\" :name \"q\" :placeholder \"Search\")", "expected_html": "" }, { "name": "fragment", "sx_input": "(<> (p \"a\") (p \"b\"))", "expected_html": "

a

b

" }, { "name": "boolean_attr", "sx_input": "(input :type \"checkbox\" :checked true)", "expected_html": "" }, { "name": "nil_attr", "sx_input": "(div :class nil \"content\")", "expected_html": "
content
" }, { "name": "empty_string_attr", "sx_input": "(div :class \"\" \"visible\")", "expected_html": "
visible
" }, { "name": "if_true", "sx_input": "(if true (p \"yes\") (p \"no\"))", "expected_html": "

yes

" }, { "name": "if_false", "sx_input": "(if false (p \"yes\") (p \"no\"))", "expected_html": "

no

" }, { "name": "when_true", "sx_input": "(when true (p \"shown\"))", "expected_html": "

shown

" }, { "name": "when_false", "sx_input": "(when false (p \"hidden\"))", "expected_html": "" }, { "name": "let_binding", "sx_input": "(let ((x \"hi\")) (p x))", "expected_html": "

hi

" }, { "name": "let_multiple", "sx_input": "(let ((x \"a\") (y \"b\")) (div (p x) (p y)))", "expected_html": "

a

b

" }, { "name": "cond_form", "sx_input": "(cond (= 1 2) (p \"no\") (= 1 1) (p \"yes\") :else (p \"default\"))", "expected_html": "

yes

" }, { "name": "case_form", "sx_input": "(case \"b\" \"a\" \"A\" \"b\" \"B\" :else \"?\")", "expected_html": "B" }, { "name": "and_short", "sx_input": "(and true false)", "expected_html": "false" }, { "name": "or_short", "sx_input": "(or false \"found\")", "expected_html": "found" }, { "name": "map_li", "sx_input": "(map (fn (x) (li x)) (list \"a\" \"b\" \"c\"))", "expected_html": "
  • a
  • b
  • c
  • " }, { "name": "filter_even", "sx_input": "(filter even? (list 1 2 3 4 5))", "expected_html": "<function <lambda> at 0x7c1551c5fe20>12345" }, { "name": "reduce_sum", "sx_input": "(reduce + 0 (list 1 2 3 4 5))", "expected_html": "15" }, { "name": "str_concat", "sx_input": "(str \"hello\" \" \" \"world\")", "expected_html": "hello world" }, { "name": "str_upcase", "sx_input": "(upcase \"hello\")", "expected_html": "HELLO" }, { "name": "defcomp_simple", "sx_input": "(do (defcomp ~test-badge (&key label) (span :class \"badge\" label)) (~test-badge :label \"New\"))", "expected_html": "New" }, { "name": "defcomp_children", "sx_input": "(do (defcomp ~test-wrap (&rest children) (div :class \"wrap\" children)) (~test-wrap (p \"inside\")))", "expected_html": "

    inside

    " }, { "name": "defcomp_multi_key", "sx_input": "(do (defcomp ~test-card (&key title subtitle) (div (h2 title) (when subtitle (p subtitle)))) (~test-card :title \"Title\" :subtitle \"Sub\"))", "expected_html": "

    Title

    Sub

    " }, { "name": "defcomp_no_optional", "sx_input": "(do (defcomp ~test-card2 (&key title subtitle) (div (h2 title) (when subtitle (p subtitle)))) (~test-card2 :title \"Only Title\"))", "expected_html": "

    Only Title

    " }, { "name": "nested_components", "sx_input": "(do (defcomp ~inner (&key text) (span :class \"inner\" text)) (defcomp ~outer (&key title &rest children) (div :class \"outer\" (h2 title) children)) (~outer :title \"Hello\" (~inner :text \"World\")))", "expected_html": "

    Hello

    World
    " }, { "name": "macro_unless", "sx_input": "(do (defmacro unless (cond &rest body) (list 'if (list 'not cond) (cons 'do body))) (unless false (p \"shown\")))", "expected_html": "

    shown

    " }, { "name": "do_block", "sx_input": "(div (do (p \"a\") (p \"b\")))", "expected_html": "

    a

    b

    " }, { "name": "nil_child", "sx_input": "(div nil \"after-nil\")", "expected_html": "
    after-nil
    " }, { "name": "number_child", "sx_input": "(div 42)", "expected_html": "
    42
    " }, { "name": "bool_child", "sx_input": "(div true)", "expected_html": "
    true
    " }, { "name": "data_attr", "sx_input": "(div :data-id \"123\" :data-name \"test\" \"content\")", "expected_html": "
    content
    " }, { "name": "raw_simple", "sx_input": "(raw! \"bold\")", "expected_html": "bold" }, { "name": "raw_in_div", "sx_input": "(div (raw! \"italic\"))", "expected_html": "
    italic
    " }, { "name": "raw_component", "sx_input": "(do (defcomp ~rich (&key html) (raw! html)) (~rich :html \"

    CMS

    \"))", "expected_html": "

    CMS

    " }, { "name": "misc_error_inline", "sx_input": "(do (defcomp ~shared:misc/error-inline (&key (message :as string)) (div :class \"text-red-600 text-sm\" message)) (~shared:misc/error-inline :message \"Something went wrong\"))", "expected_html": "
    Something went wrong
    " }, { "name": "misc_notification_badge", "sx_input": "(do (defcomp ~shared:misc/notification-badge (&key (count :as number)) (span :class \"bg-red-500 text-white text-xs rounded-full px-1.5 py-0.5\" count)) (~shared:misc/notification-badge :count 5))", "expected_html": "5" }, { "name": "misc_cache_cleared", "sx_input": "(do (defcomp ~shared:misc/cache-cleared (&key (time-str :as string)) (span :class \"text-green-600 font-bold\" \"Cache cleared at \" time-str)) (~shared:misc/cache-cleared :time-str \"12:00\"))", "expected_html": "Cache cleared at 12:00" }, { "name": "misc_error_list_item", "sx_input": "(do (defcomp ~shared:misc/error-list-item (&key (message :as string)) (li message)) (~shared:misc/error-list-item :message \"Bad input\"))", "expected_html": "
  • Bad input
  • " }, { "name": "misc_fragment_error", "sx_input": "(do (defcomp ~shared:misc/fragment-error (&key (service :as string)) (p :class \"text-sm text-red-600\" \"Service \" (b service) \" is unavailable.\")) (~shared:misc/fragment-error :service \"blog\"))", "expected_html": "

    Service blog is unavailable.

    " } ]