HS: sourceInfo (+4 tests)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2015,6 +2015,47 @@ def generate_eval_only_test(test, idx):
|
||||
f' )'
|
||||
)
|
||||
|
||||
# Special case: cluster-38 sourceInfo tests.
|
||||
if test['name'] == 'debug':
|
||||
return (
|
||||
f' (deftest "{safe_name}"\n'
|
||||
f' (assert= (hs-src "<button.foo/>") "<button.foo/>"))'
|
||||
)
|
||||
|
||||
if test['name'] == 'get source works for expressions':
|
||||
return (
|
||||
f' (deftest "{safe_name}"\n'
|
||||
f' (assert= (hs-src "1") "1")\n'
|
||||
f' (assert= (hs-src "a.b") "a.b")\n'
|
||||
f' (assert= (hs-src-at "a.b" (list :root)) "a")\n'
|
||||
f' (assert= (hs-src "a.b()") "a.b()")\n'
|
||||
f' (assert= (hs-src-at "a.b()" (list :root)) "a.b")\n'
|
||||
f' (assert= (hs-src-at "a.b()" (list :root :root)) "a")\n'
|
||||
f' (assert= (hs-src "<button.foo/>") "<button.foo/>")\n'
|
||||
f' (assert= (hs-src "x + y") "x + y")\n'
|
||||
f' (assert= (hs-src-at "x + y" (list :lhs)) "x")\n'
|
||||
f' (assert= (hs-src-at "x + y" (list :rhs)) "y")\n'
|
||||
f" (assert= (hs-src \"'foo'\") \"'foo'\")\n"
|
||||
f' (assert= (hs-src ".foo") ".foo")\n'
|
||||
f' (assert= (hs-src "#bar") "#bar"))'
|
||||
)
|
||||
|
||||
if test['name'] == 'get source works for statements':
|
||||
return (
|
||||
f' (deftest "{safe_name}"\n'
|
||||
f" (assert= (hs-src \"if true log 'it was true'\") \"if true log 'it was true'\")\n"
|
||||
f' (assert= (hs-src "for x in [1, 2, 3] log x then log x end") "for x in [1, 2, 3] log x then log x end"))'
|
||||
)
|
||||
|
||||
if test['name'] == 'get line works for statements':
|
||||
src = "if true\\n log 'it was true'\\n log 'it was true'"
|
||||
return (
|
||||
f' (deftest "{safe_name}"\n'
|
||||
f' (assert= (hs-line-at "{src}" (list)) "if true")\n'
|
||||
f" (assert= (hs-line-at \"{src}\" (list :true-branch)) \" log 'it was true'\")\n"
|
||||
f" (assert= (hs-line-at \"{src}\" (list :true-branch :next)) \" log 'it was true'\"))"
|
||||
)
|
||||
|
||||
lines.append(f' (deftest "{safe_name}"')
|
||||
|
||||
assertions = []
|
||||
|
||||
Reference in New Issue
Block a user