<commit_before>#!../../parrot tcl.pbc

source lib/test_more.tcl

plan 6

eval_is {
  variable
} {wrong # args: should be "variable ?name value...? name ?value?"} \
  {bad args}

eval_is {variable foo} {} {variable's return value}

eval_is {
  catch {unset foo}
  catch {unset bar}
  variable foo 3 bar 5
  list $foo $bar
} {3 5} {variable foo 3 bar 5}

eval_is {
  catch {unset foo}
  variable foo
  set foo
} {can't read "foo": no such variable} \
  {variable foo}

eval_is {
  catch {unset foo}
  catch {unset bar}
  variable foo 3 bar
  list $foo [catch {set bar} msg] $msg
} {3 1 {can't read "bar": no such variable}} \
  {variable foo 3 bar}

eval_is {variable foo(bar)} \
  {can't define "foo(bar)": name refers to an element in an array} \
  {variable with array} \
  {TODO {can't handle this yet}}<commit_msg>[tcl]: Another TODO'd [variable] test<commit_after>#!../../parrot tcl.pbc

source lib/test_more.tcl

plan 7

eval_is {
  variable
} {wrong # args: should be "variable ?name value...? name ?value?"} \
  {bad args}

eval_is {variable foo} {} {variable's return value}

eval_is {
  catch {unset foo}
  catch {unset bar}
  variable foo 3 bar 5
  list $foo $bar
} {3 5} {variable foo 3 bar 5}

eval_is {
  catch {unset foo}
  variable foo
  set foo
} {can't read "foo": no such variable} \
  {variable foo}

eval_is {
  catch {unset foo}
  catch {unset bar}
  variable foo 3 bar
  list $foo [catch {set bar} msg] $msg
} {3 1 {can't read "bar": no such variable}} \
  {variable foo 3 bar}

eval_is {variable foo(bar)} \
  {can't define "foo(bar)": name refers to an element in an array} \
  {variable with array} \
  {TODO {can't handle this yet}}

eval_is {
  proc test {} {
    variable x 5
    set x
  }
  list [test] [set x]
} {5 5} {variable is always about globals} \
  {TODO {can't handle this yet}}
{'fraction_non_alphanumeric': 0.13428728673637866, 'fraction_numerical': 0.01375894331315355, 'mean_word_length': 3.160183066361556, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7462130', 'n_tokens_mistral': 704, 'n_tokens_neox': 668, 'n_words': 257}