<commit_before>REBOL [
  Title: "Red/System compilation error test"
  File:  %comp-err-test.r
  License: "BSD-3 - https://github.com/dockimbel/Red/blob/master/BSD-3-License.txt"
]

change-dir %../                   ;; revert to tests/ dir (from runnable)
  
~~~start-file~~~ "comp-err"

  --test-- "sample compilation error test"
  --compile-this {
      i := 1;
    }     
  --assert none <> find qt/comp-output "*** Compilation Error: undefined symbol"
  --assert none <> find qt/comp-output "line: 3"
  --assert none <> find qt/comp-output "at: [i := 1]"
  --clean
  
~~~end-file~~~
<commit_msg>TESTS: added a new compilation test for error line reporting from functions<commit_after>REBOL [
  Title: "Red/System compilation error test"
  File:  %comp-err-test.r
  License: "BSD-3 - https://github.com/dockimbel/Red/blob/master/BSD-3-License.txt"
]

change-dir %../                   ;; revert to tests/ dir (from runnable)
  
~~~start-file~~~ "comp-err"

  --test-- "sample compilation error test"
  --compile-this {
      i := 1;
    }     
  --assert none <> find qt/comp-output "*** Compilation Error: undefined symbol"
  --assert none <> find qt/comp-output "at line: 3"
  --assert none <> find qt/comp-output "near: [i := 1]"
  --clean


 --test-- "error line reporting test"
  --compile-this {
      foo: func [][
      	if true [
      		either true [
      			a
      		][
      			123
      		]
      	]
      ]
    }     
  --assert none <> find qt/comp-output "*** Compilation Error: undefined symbol: a"
  --assert none <> find qt/comp-output "at line: 6"
  --clean

  
~~~end-file~~~

{'fraction_non_alphanumeric': 0.16427232979387882, 'fraction_numerical': 0.008744534665833853, 'mean_word_length': 2.191235059760956, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 2, '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': '5100488', 'n_tokens_mistral': 592, 'n_tokens_neox': 543, 'n_words': 145}