<commit_before>#!/usr/bin/perl

use strict;
use lib qw(tcl/t t . ../lib ../../lib ../../../lib);
use Parrot::Test tests => 9;

language_output_is("tcl",<<'TCL',<<OUT,"discard error");
  catch {
    error dead
  }
TCL
OUT

language_output_is("tcl",<<'TCL',<<OUT,"error message");
  catch {
    error dead
  } var
  puts $var
TCL
dead
OUT

language_output_is("tcl",<<'TCL',<<OUT,"error type: none");
  set a [catch {
    set b 0
  }]
  puts $a
TCL
0
OUT

language_output_is("tcl",<<'TCL',<<OUT,"error type: error");
  set a [catch {
    error dead
  }]
  puts $a
TCL
1
OUT

language_output_is("tcl",<<'TCL',<<OUT,"error type: return");
  set a [catch {
    return
  }]
  puts $a
TCL
2
OUT

language_output_is("tcl",<<'TCL',<<OUT,"error type: break");
  set a [catch {
    break
  }]
  puts $a
TCL
3
OUT

language_output_is("tcl",<<'TCL',<<OUT,"error type: continue");
  set a [catch {
    continue
  }]
  puts $a
TCL
4
OUT

language_output_is("tcl",<<'TCL',<<OUT,"error, invalid command");
  catch blorg var
  puts $var
TCL
invalid command name "blorg"
OUT

language_output_is("tcl",<<'TCL',<<OUT,"bad args");
  catch
TCL
wrong # args: should be "catch command ?varName?"
OUT<commit_msg>Pass t-tcl/error.t #'s 6 & 11<commit_after>#!/usr/bin/perl

use strict;
use lib qw(tcl/t t . ../lib ../../lib ../../../lib);
use Parrot::Test tests => 9;

language_output_is("tcl",<<'TCL',<<OUT,"discard error");
  catch {
    error dead
  }
TCL
OUT

language_output_is("tcl",<<'TCL',<<OUT,"error message");
  catch {
    error dead
  } var
  puts $var
TCL
dead
OUT

language_output_is("tcl",<<'TCL',<<OUT,"error type: none");
  set a [catch {
    set b 0
  }]
  puts $a
TCL
0
OUT

language_output_is("tcl",<<'TCL',<<OUT,"error type: error");
  set a [catch {
    error dead
  }]
  puts $a
TCL
1
OUT

language_output_is("tcl",<<'TCL',<<OUT,"error type: return");
  set a [catch {
    return
  }]
  puts $a
TCL
2
OUT

language_output_is("tcl",<<'TCL',<<OUT,"error type: break");
  set a [catch {
    break
  }]
  puts $a
TCL
3
OUT

language_output_is("tcl",<<'TCL',<<OUT,"error type: continue");
  set a [catch {
    continue
  }]
  puts $a
TCL
4
OUT

language_output_is("tcl",<<'TCL',<<OUT,"error, invalid command");
  catch blorg var
  puts $var
TCL
invalid command name "blorg"
OUT

language_output_is("tcl",<<'TCL',<<'OUT',"bad args");
  catch
TCL
wrong # args: should be "catch script ?resultVarName? ?optionVarName?"
OUT
{'fraction_non_alphanumeric': 0.1917808219178082, 'fraction_numerical': 0.007056870070568701, 'mean_word_length': 3.8393574297188753, 'pattern_counts': {'":': 0, '<': 75, '<?xml version=': 0, '>': 5, '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': '5600793', 'n_tokens_mistral': 1002, 'n_tokens_neox': 986, 'n_words': 246}