about summary refs log tree commit diff stats
path: root/subx/test_apps
Commit message (Expand)AuthorAgeFilesLines
* 5411Kartik Agaram2019-07-171-1/+1
* 5410 - 4 examples passingKartik Agaram2019-07-171-12/+30
* 5409Kartik Agaram2019-07-171-0/+10
* add subx/apps/survey to CIKartik Agaram2019-07-131-0/+10
* 5222Kartik Agaram2019-05-221-2/+2
* 5219Kartik Agaram2019-05-221-2/+6
* SubX in SubX: done with dquotes phaseKartik Agaram2019-05-201-0/+10
* switch to new syntax for segment headers in C++Kartik Agaram2019-05-181-7/+7
* 5126 - add a message to a silent CI failure modeKartik Agaram2019-04-261-19/+19
* 5120Kartik Agaram2019-04-231-1/+1
* 5105Kartik Agaram2019-04-161-7/+7
* 5092Kartik Agaram2019-04-151-2/+2
* 5085 - 'assort' phase done!Kartik Agaram2019-04-121-0/+10
* 5058Kartik Agaram2019-04-051-1/+1
* 4962Kartik Agaram2019-02-141-38/+40
* 4939Kartik Agaram2019-01-211-0/+10
* 4903Kartik Agaram2019-01-031-2/+0
* 4894Kartik Agaram2018-12-301-0/+10
* 4888Kartik Agaram2018-12-291-5/+5
* 4852Kartik Agaram2018-12-061-0/+10
* 4775Kartik Agaram2018-11-241-0/+10
* 4774Kartik Agaram2018-11-241-4/+0
* 4763 - back to the 'trivial' crenshaw2-1 compilerKartik Agaram2018-11-231-0/+4
* 4744Kartik Agaram2018-11-171-2/+2
* 4729Kartik Agaram2018-10-281-2/+2
* 4727 - commit to better 64-bit supportKartik Agaram2018-10-271-15/+14
* 4684Kartik Agaram2018-10-111-1/+7
* 4664 - subx: reflect test failures in exit statusKartik Agaram2018-10-051-13/+5
* 4648Kartik Agaram2018-10-011-0/+8
* 4647 - support 64-bit Linux in CIKartik Agaram2018-10-011-0/+148
314'>314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Mu - edit/010-errors.mu</title>
<meta name="Generator" content="Vim/7.4">
<meta name="plugin-version" content="vim7.4_v1">
<meta name="syntax" content="none">
<meta name="settings" content="use_css,pre_wrap,no_foldcolumn,expand_tabs,prevent_copy=">
<meta name="colorscheme" content="minimal">
<style type="text/css">
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; }
body { font-family: monospace; color: #eeeeee; background-color: #080808; }
* { font-size: 1.05em; }
.muControl { color: #c0a020; }
.muRecipe { color: #ff8700; }
.Special { color: #ff6060; }
.muData { color: #ffff00; }
.Comment { color: #9090ff; }
.Constant { color: #00a0a0; }
.SalientComment { color: #00ffff; }
.CommentedCode { color: #6c6c6c; }
.Delimiter { color: #a04060; }
.muScenario { color: #00af00; }
-->
</style>

<script type='text/javascript'>
<!--

-->
</script>
</head>
<body>
<pre id='vimCodeElement'>
<span class="SalientComment">## handling malformed programs</span>

<span class="muData">container</span> programming-environment-data [
  recipe-errors:address:shared:array:character
]

<span class="Comment"># copy code from recipe editor, persist, load into mu, save any errors</span>
<span class="muRecipe">recipe!</span> update-recipes env:address:shared:programming-environment-data, screen:address:shared:screen<span class="muRecipe"> -&gt; </span>errors-found?:boolean, env:address:shared:programming-environment-data, screen:address:shared:screen [
  <span class="Constant">local-scope</span>
  <span class="Constant">load-ingredients</span>
<span class="CommentedCode">#?   $log [update recipes]</span>
  recipes:address:shared:editor-data<span class="Special"> &lt;- </span>get *env, <span class="Constant">recipes:offset</span>
  in:address:shared:array:character<span class="Special"> &lt;- </span>editor-contents recipes
  save <span class="Constant">[recipes.mu]</span>, in
  recipe-errors:address:address:shared:array:character<span class="Special"> &lt;- </span>get-address *env, <span class="Constant">recipe-errors:offset</span>
  *recipe-errors<span class="Special"> &lt;- </span>reload in
  <span class="Comment"># if recipe editor has errors, stop</span>
  <span class="Delimiter">{</span>
    <span class="muControl">break-unless</span> *recipe-errors
    status:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[errors found     ]</span>
    update-status screen, status, <span class="Constant">1/red</span>
    errors-found?<span class="Special"> &lt;- </span>copy <span class="Constant">1/true</span>
    <span class="muControl">reply</span>
  <span class="Delimiter">}</span>
  errors-found?<span class="Special"> &lt;- </span>copy <span class="Constant">0/false</span>
]

<span class="muRecipe">before</span> <span class="Constant">&lt;render-components-end&gt;</span> [
  trace <span class="Constant">11</span>, <span class="Constant">[app]</span>, <span class="Constant">[render status]</span>
  recipe-errors:address:shared:array:character<span class="Special"> &lt;- </span>get *env, <span class="Constant">recipe-errors:offset</span>
  <span class="Delimiter">{</span>
    <span class="muControl">break-unless</span> recipe-errors
    status:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[errors found     ]</span>
    update-status screen, status, <span class="Constant">1/red</span>
  <span class="Delimiter">}</span>
]

<span class="muRecipe">before</span> <span class="Constant">&lt;render-recipe-components-end&gt;</span> [
  <span class="Delimiter">{</span>
    recipe-errors:address:shared:array:character<span class="Special"> &lt;- </span>get *env, <span class="Constant">recipe-errors:offset</span>
    <span class="muControl">break-unless</span> recipe-errors
    row, screen<span class="Special"> &lt;- </span>render screen, recipe-errors, left, right, <span class="Constant">1/red</span>, row
  <span class="Delimiter">}</span>
]

<span class="muData">container</span> programming-environment-data [
  error-index:number  <span class="Comment"># index of first sandbox with an error (or -1 if none)</span>
]

<span class="muRecipe">after</span> <span class="Constant">&lt;programming-environment-initialization&gt;</span> [
  error-index:address:number<span class="Special"> &lt;- </span>get-address *result, <span class="Constant">error-index:offset</span>
  *error-index<span class="Special"> &lt;- </span>copy <span class="Constant">-1</span>
]

<span class="muRecipe">after</span> <span class="Constant">&lt;run-sandboxes-begin&gt;</span> [
  error-index:address:number<span class="Special"> &lt;- </span>get-address *env, <span class="Constant">error-index:offset</span>
  *error-index<span class="Special"> &lt;- </span>copy <span class="Constant">-1</span>
]

<span class="muRecipe">before</span> <span class="Constant">&lt;run-sandboxes-end&gt;</span> [
  <span class="Delimiter">{</span>
    sandboxes-completed-successfully?:boolean<span class="Special"> &lt;- </span>equal *error-index, <span class="Constant">-1</span>
    <span class="muControl">break-if</span> sandboxes-completed-successfully?
    errors-found?<span class="Special"> &lt;- </span>copy <span class="Constant">1/true</span>
  <span class="Delimiter">}</span>
]

<span class="muRecipe">before</span> <span class="Constant">&lt;render-components-end&gt;</span> [
  <span class="Delimiter">{</span>
    <span class="muControl">break-if</span> recipe-errors
    error-index:number<span class="Special"> &lt;- </span>get *env, <span class="Constant">error-index:offset</span>
    sandboxes-completed-successfully?:boolean<span class="Special"> &lt;- </span>equal error-index, <span class="Constant">-1</span>
    <span class="muControl">break-if</span> sandboxes-completed-successfully?
    status-template:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[errors found (_)    ]</span>
    error-index-text:address:shared:array:character<span class="Special"> &lt;- </span>to-text error-index
    status:address:shared:array:character<span class="Special"> &lt;- </span>interpolate status-template, error-index-text
<span class="CommentedCode">#?     $print [update-status: sandbox error], 10/newline</span>
    update-status screen, status, <span class="Constant">1/red</span>
<span class="CommentedCode">#?     $print [run sandboxes end], 10/newline</span>
  <span class="Delimiter">}</span>
]

<span class="muData">container</span> sandbox-data [
  errors:address:shared:array:character
]

<span class="muRecipe">recipe!</span> update-sandbox sandbox:address:shared:sandbox-data, env:address:shared:programming-environment-data, idx:number<span class="muRecipe"> -&gt; </span>sandbox:address:shared:sandbox-data, env:address:shared:programming-environment-data [
  <span class="Constant">local-scope</span>
  <span class="Constant">load-ingredients</span>
<span class="CommentedCode">#?   $log [update sandbox]</span>
  data:address:shared:array:character<span class="Special"> &lt;- </span>get *sandbox, <span class="Constant">data:offset</span>
  response:address:address:shared:array:character<span class="Special"> &lt;- </span>get-address *sandbox, <span class="Constant">response:offset</span>
  errors:address:address:shared:array:character<span class="Special"> &lt;- </span>get-address *sandbox, <span class="Constant">errors:offset</span>
  trace:address:address:shared:array:character<span class="Special"> &lt;- </span>get-address *sandbox, <span class="Constant">trace:offset</span>
  fake-screen:address:address:shared:screen<span class="Special"> &lt;- </span>get-address *sandbox, <span class="Constant">screen:offset</span>
<span class="CommentedCode">#?   $print [run-interactive], 10/newline</span>
  *response, *errors, *fake-screen, *trace, completed?:boolean<span class="Special"> &lt;- </span>run-interactive data
  <span class="Delimiter">{</span>
    <span class="muControl">break-if</span> *errors
    <span class="muControl">break-if</span> completed?:boolean
    *errors<span class="Special"> &lt;- </span>new <span class="Constant">[took too long!</span>
<span class="Constant">]</span>
  <span class="Delimiter">}</span>
  <span class="Delimiter">{</span>
    <span class="muControl">break-unless</span> *errors
<span class="CommentedCode">#?     $print [setting error-index to ], idx, 10/newline</span>
    error-index:address:number<span class="Special"> &lt;- </span>get-address *env, <span class="Constant">error-index:offset</span>
    error-not-set?:boolean<span class="Special"> &lt;- </span>equal *error-index, <span class="Constant">-1</span>
    <span class="muControl">break-unless</span> error-not-set?
    *error-index<span class="Special"> &lt;- </span>copy idx
  <span class="Delimiter">}</span>
<span class="CommentedCode">#?   $print [done with run-interactive], 10/newline</span>
]

<span class="Comment"># make sure we render any trace</span>
<span class="muRecipe">after</span> <span class="Constant">&lt;render-sandbox-trace-done&gt;</span> [
  <span class="Delimiter">{</span>
    sandbox-errors:address:shared:array:character<span class="Special"> &lt;- </span>get *sandbox, <span class="Constant">errors:offset</span>
    <span class="muControl">break-unless</span> sandbox-errors
    response-starting-row:address:number<span class="Special"> &lt;- </span>get-address *sandbox, <span class="Constant">response-starting-row-on-screen:offset</span>
    *response-starting-row<span class="Special"> &lt;- </span>copy <span class="Constant">0</span>  <span class="Comment"># no response</span>
    row, screen<span class="Special"> &lt;- </span>render screen, sandbox-errors, left, right, <span class="Constant">1/red</span>, row
    <span class="Comment"># don't try to print anything more for this sandbox</span>
    <span class="muControl">jump</span> <span class="Constant">+render-sandbox-end:label</span>
  <span class="Delimiter">}</span>
]

<span class="muScenario">scenario</span> run-shows-errors-in-get [
  trace-until <span class="Constant">100/app</span>  <span class="Comment"># trace too long</span>
  assume-screen <span class="Constant">100/width</span>, <span class="Constant">15/height</span>
  <span class="Constant">1</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[ </span>
<span class="Constant">recipe foo [</span>
<span class="Constant">  get 123:number, foo:offset</span>
<span class="Constant">]</span>]
  <span class="Constant">2</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[foo]</span>
  <span class="Constant">3</span>:address:shared:programming-environment-data<span class="Special"> &lt;- </span>new-programming-environment screen:address:shared:screen, <span class="Constant">1</span>:address:shared:array:character, <span class="Constant">2</span>:address:shared:array:character
  assume-console [
    press F4
  ]
  run [
    event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
  ]
  screen-should-contain [
   <span class="Constant"> .  errors found                                                                   run (F4)           .</span>
   <span class="Constant"> .                                                  β”Šfoo                                              .</span>
   <span class="Constant"> .recipe foo [                                      β”Šβ”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”.</span>
   <span class="Constant"> .  get 123:number, foo:offset                      β”Š                                                 .</span>
   <span class="Constant"> .]                                                 β”Š                                                 .</span>
   <span class="Constant"> .foo: unknown element foo in container number      β”Š                                                 .</span>
   <span class="Constant"> .foo: first ingredient of 'get' should be a contaiβ†©β”Š                                                 .</span>
   <span class="Constant"> .ner, but got 123:number                           β”Š                                                 .</span>
   <span class="Constant"> .β”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”Š                                                 .</span>
   <span class="Constant"> .                                                  β”Š                                                 .</span>
  ]
  screen-should-contain-in-color <span class="Constant">1/red</span>, [
   <span class="Constant"> .  errors found                                                                                      .</span>
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .foo: unknown element foo in container number                                                        .</span>
   <span class="Constant"> .foo: first ingredient of 'get' should be a contai                                                   .</span>
   <span class="Constant"> .ner, but got 123:number                                                                             .</span>
   <span class="Constant"> .                                                                                                    .</span>
  ]
]

<span class="muScenario">scenario</span> run-updates-status-with-first-erroneous-sandbox [
  trace-until <span class="Constant">100/app</span>  <span class="Comment"># trace too long</span>
  assume-screen <span class="Constant">100/width</span>, <span class="Constant">15/height</span>
  <span class="Constant">1</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[]</span>
  <span class="Constant">2</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[]</span>
  <span class="Constant">3</span>:address:shared:programming-environment-data<span class="Special"> &lt;- </span>new-programming-environment screen:address:shared:screen, <span class="Constant">1</span>:address:shared:array:character, <span class="Constant">2</span>:address:shared:array:character
  assume-console [
    left-click <span class="Constant">3</span>, <span class="Constant">80</span>
    <span class="Comment"># create invalid sandbox 1</span>
    type <span class="Constant">[get foo, x:offset]</span>
    press F4
    <span class="Comment"># create invalid sandbox 0</span>
    type <span class="Constant">[get foo, x:offset]</span>
    press F4
  ]
  run [
    event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
  ]
  <span class="Comment"># status line shows that error is in first sandbox</span>
  screen-should-contain [
   <span class="Constant"> .  errors found (0)                                                               run (F4)           .</span>
  ]
]

<span class="muScenario">scenario</span> run-updates-status-with-first-erroneous-sandbox-2 [
  trace-until <span class="Constant">100/app</span>  <span class="Comment"># trace too long</span>
  assume-screen <span class="Constant">100/width</span>, <span class="Constant">15/height</span>
  <span class="Constant">1</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[]</span>
  <span class="Constant">2</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[]</span>
  <span class="Constant">3</span>:address:shared:programming-environment-data<span class="Special"> &lt;- </span>new-programming-environment screen:address:shared:screen, <span class="Constant">1</span>:address:shared:array:character, <span class="Constant">2</span>:address:shared:array:character
  assume-console [
    left-click <span class="Constant">3</span>, <span class="Constant">80</span>
    <span class="Comment"># create invalid sandbox 2</span>
    type <span class="Constant">[get foo, x:offset]</span>
    press F4
    <span class="Comment"># create invalid sandbox 1</span>
    type <span class="Constant">[get foo, x:offset]</span>
    press F4
    <span class="Comment"># create valid sandbox 0</span>
    type <span class="Constant">[add 2, 2]</span>
    press F4
  ]
  run [
    event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
  ]
  <span class="Comment"># status line shows that error is in second sandbox</span>
  screen-should-contain [
   <span class="Constant"> .  errors found (1)                                                               run (F4)           .</span>
  ]
]

<span class="muScenario">scenario</span> run-hides-errors-from-past-sandboxes [
  trace-until <span class="Constant">100/app</span>  <span class="Comment"># trace too long</span>
  assume-screen <span class="Constant">100/width</span>, <span class="Constant">15/height</span>
  <span class="Constant">1</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[]</span>
  <span class="Constant">2</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[get foo, x:offset]</span>  <span class="Comment"># invalid</span>
  <span class="Constant">3</span>:address:shared:programming-environment-data<span class="Special"> &lt;- </span>new-programming-environment screen:address:shared:screen, <span class="Constant">1</span>:address:shared:array:character, <span class="Constant">2</span>:address:shared:array:character
  assume-console [
    press F4  <span class="Comment"># generate error</span>
  ]
  run [
    event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
  ]
  assume-console [
    left-click <span class="Constant">3</span>, <span class="Constant">80</span>
    press ctrl-k
    type <span class="Constant">[add 2, 2]</span>  <span class="Comment"># valid code</span>
    press F4  <span class="Comment"># update sandbox</span>
  ]
  run [
    event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
  ]
  <span class="Comment"># error should disappear</span>
  screen-should-contain [
   <span class="Constant"> .                                                                                 run (F4)           .</span>
   <span class="Constant"> .                                                  β”Š                                                 .</span>
<span class="Constant">    .β”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”Šβ”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”.</span>
   <span class="Constant"> .                                                  β”Š0                                               x.</span>
   <span class="Constant"> .                                                  β”Šadd 2, 2                                         .</span>
   <span class="Constant"> .                                                  β”Š4                                                .</span>
   <span class="Constant"> .                                                  β”Šβ”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”.</span>
   <span class="Constant"> .                                                  β”Š                                                 .</span>
  ]
]

<span class="muScenario">scenario</span> run-updates-errors-for-shape-shifting-recipes [
  trace-until <span class="Constant">100/app</span>  <span class="Comment"># trace too long</span>
  assume-screen <span class="Constant">100/width</span>, <span class="Constant">15/height</span>
  <span class="Comment"># define a shape-shifting recipe with an error</span>
  <span class="Constant">1</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[recipe foo x:_elem -&gt; z:_elem [</span>
<span class="Constant">local-scope</span>
<span class="Constant">load-ingredients</span>
<span class="Constant">z &lt;- add x, [a]</span>
]]
  <span class="Constant">2</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[foo 2]</span>
  <span class="Constant">3</span>:address:shared:programming-environment-data<span class="Special"> &lt;- </span>new-programming-environment screen:address:shared:screen, <span class="Constant">1</span>:address:shared:array:character, <span class="Constant">2</span>:address:shared:array:character
  assume-console [
    press F4
  ]
  event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
  screen-should-contain [
   <span class="Constant"> .  errors found (0)                                                               run (F4)           .</span>
   <span class="Constant"> .recipe foo x:_elem -&gt; z:_elem [                   β”Š                                                 .</span>
   <span class="Constant"> .local-scope                                       β”Šβ”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”.</span>
   <span class="Constant"> .load-ingredients                                  β”Š0                                               x.</span>
   <span class="Constant"> .z &lt;- add x, [a]                                   β”Šfoo 2                                            .</span>
   <span class="Constant"> .]                                                 β”Šfoo_2: 'add' requires number ingredients, but go↩.</span>
   <span class="Constant"> .β”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”Št [a]                                            .</span>
   <span class="Constant"> .                                                  β”Šβ”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”.</span>
   <span class="Constant"> .                                                  β”Š                                                 .</span>
  ]
  <span class="Comment"># now rerun everything</span>
  assume-console [
    press F4
  ]
  run [
    event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
  ]
  <span class="Comment"># error should remain unchanged</span>
  screen-should-contain [
   <span class="Constant"> .  errors found (0)                                                               run (F4)           .</span>
   <span class="Constant"> .recipe foo x:_elem -&gt; z:_elem [                   β”Š                                                 .</span>
   <span class="Constant"> .local-scope                                       β”Šβ”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”.</span>
   <span class="Constant"> .load-ingredients                                  β”Š0                                               x.</span>
   <span class="Constant"> .z &lt;- add x, [a]                                   β”Šfoo 2                                            .</span>
   <span class="Constant"> .]                                                 β”Šfoo_2: 'add' requires number ingredients, but go↩.</span>
   <span class="Constant"> .β”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”Št [a]                                            .</span>
   <span class="Constant"> .                                                  β”Šβ”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”.</span>
   <span class="Constant"> .                                                  β”Š                                                 .</span>
  ]
]

<span class="muScenario">scenario</span> run-avoids-spurious-errors-on-reloading-shape-shifting-recipes [
  trace-until <span class="Constant">100/app</span>  <span class="Comment"># trace too long</span>
  assume-screen <span class="Constant">100/width</span>, <span class="Constant">15/height</span>
  <span class="Comment"># overload a well-known shape-shifting recipe</span>
  <span class="Constant">1</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[recipe length l:address:shared:list:_elem -&gt; n:number [</span>
<span class="Constant">]</span>]
  <span class="Comment"># call code that uses other variants of it, but not it itself</span>
  <span class="Constant">2</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[x:address:shared:list:number &lt;- copy 0</span>
<span class="Constant">to-text x]</span>
  <span class="Constant">3</span>:address:shared:programming-environment-data<span class="Special"> &lt;- </span>new-programming-environment screen:address:shared:screen, <span class="Constant">1</span>:address:shared:array:character, <span class="Constant">2</span>:address:shared:array:character
  <span class="Comment"># run it once</span>
  assume-console [
    press F4
  ]
  event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
  <span class="Comment"># no errors anywhere on screen (can't check anything else, since to-text will return an address)</span>
  screen-should-contain-in-color <span class="Constant">1/red</span>, [
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                                                &lt;-                  .</span>
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                                                                    .</span>
  ]
  <span class="Comment"># rerun everything</span>
  assume-console [
    press F4
  ]
  run [
    event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
  ]
  <span class="Comment"># still no errors</span>
  screen-should-contain-in-color <span class="Constant">1/red</span>, [
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                                                &lt;-                  .</span>
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                                                                    .</span>
  ]
]

<span class="muScenario">scenario</span> run-shows-missing-type-errors [
  trace-until <span class="Constant">100/app</span>  <span class="Comment"># trace too long</span>
  assume-screen <span class="Constant">100/width</span>, <span class="Constant">15/height</span>
  <span class="Constant">1</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[ </span>
<span class="Constant">recipe foo [</span>
<span class="Constant">  x &lt;- copy 0</span>
<span class="Constant">]</span>]
  <span class="Constant">2</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[foo]</span>
  <span class="Constant">3</span>:address:shared:programming-environment-data<span class="Special"> &lt;- </span>new-programming-environment screen:address:shared:screen, <span class="Constant">1</span>:address:shared:array:character, <span class="Constant">2</span>:address:shared:array:character
  assume-console [
    press F4
  ]
  run [
    event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
  ]
  screen-should-contain [
   <span class="Constant"> .  errors found                                                                   run (F4)           .</span>
   <span class="Constant"> .                                                  β”Šfoo                                              .</span>
   <span class="Constant"> .recipe foo [                                      β”Šβ”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”.</span>
   <span class="Constant"> .  x &lt;- copy 0                                     β”Š                                                 .</span>
   <span class="Constant"> .]                                                 β”Š                                                 .</span>
   <span class="Constant"> .foo: missing type for x in 'x &lt;- copy 0'          β”Š                                                 .</span>
  ]
]

<span class="muScenario">scenario</span> run-shows-unbalanced-bracket-errors [
  trace-until <span class="Constant">100/app</span>  <span class="Comment"># trace too long</span>
  assume-screen <span class="Constant">100/width</span>, <span class="Constant">15/height</span>
  <span class="Comment"># recipe is incomplete (unbalanced '[')</span>
  <span class="Constant">1</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[ </span>
<span class="Constant">recipe foo Β«</span>
<span class="Constant">  x &lt;- copy 0</span>
<span class="Constant">]</span>
  replace <span class="Constant">1</span>:address:shared:array:character, <span class="Constant">171/Β«</span>, <span class="Constant">91</span>  <span class="Comment"># '['</span>
  <span class="Constant">2</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[foo]</span>
  <span class="Constant">3</span>:address:shared:programming-environment-data<span class="Special"> &lt;- </span>new-programming-environment screen:address:shared:screen, <span class="Constant">1</span>:address:shared:array:character, <span class="Constant">2</span>:address:shared:array:character
  assume-console [
    press F4
  ]
  run [
    event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
  ]
  screen-should-contain [
   <span class="Constant"> .  errors found                                                                   run (F4)           .</span>
   <span class="Constant"> .                                                  β”Šfoo                                              .</span>
   <span class="Constant"> .recipe foo \\\[                                      β”Šβ”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”.</span>
   <span class="Constant"> .  x &lt;- copy 0                                     β”Š                                                 .</span>
   <span class="Constant"> .                                                  β”Š                                                 .</span>
   <span class="Constant"> .9: unbalanced '\\\[' for recipe                      β”Š                                                 .</span>
   <span class="Constant"> .β”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”Š                                                 .</span>
   <span class="Constant"> .                                                  β”Š                                                 .</span>
  ]
]

<span class="muScenario">scenario</span> run-shows-get-on-non-container-errors [
  trace-until <span class="Constant">100/app</span>  <span class="Comment"># trace too long</span>
  assume-screen <span class="Constant">100/width</span>, <span class="Constant">15/height</span>
  <span class="Constant">1</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[ </span>
<span class="Constant">recipe foo [</span>
<span class="Constant">  local-scope</span>
<span class="Constant">  x:address:shared:point &lt;- new point:type</span>
<span class="Constant">  get x:address:shared:point, 1:offset</span>
<span class="Constant">]</span>]
  <span class="Constant">2</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[foo]</span>
  <span class="Constant">3</span>:address:shared:programming-environment-data<span class="Special"> &lt;- </span>new-programming-environment screen:address:shared:screen, <span class="Constant">1</span>:address:shared:array:character, <span class="Constant">2</span>:address:shared:array:character
  assume-console [
    press F4
  ]
  run [
    event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
  ]
  screen-should-contain [
   <span class="Constant"> .  errors found                                                                   run (F4)           .</span>
   <span class="Constant"> .                                                  β”Šfoo                                              .</span>
   <span class="Constant"> .recipe foo [                                      β”Šβ”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”.</span>
   <span class="Constant"> .  local-scope                                     β”Š                                                 .</span>
   <span class="Constant"> .  x:address:shared:point &lt;- new point:type        β”Š                                                 .</span>
   <span class="Constant"> .  get x:address:shared:point, 1:offset            β”Š                                                 .</span>
   <span class="Constant"> .]                                                 β”Š                                                 .</span>
   <span class="Constant"> .foo: first ingredient of 'get' should be a contaiβ†©β”Š                                                 .</span>
   <span class="Constant"> .ner, but got x:address:shared:point               β”Š                                                 .</span>
   <span class="Constant"> .β”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”Š                                                 .</span>
   <span class="Constant"> .                                                  β”Š                                                 .</span>
  ]
]

<span class="muScenario">scenario</span> run-shows-non-literal-get-argument-errors [
  trace-until <span class="Constant">100/app</span>  <span class="Comment"># trace too long</span>
  assume-screen <span class="Constant">100/width</span>, <span class="Constant">15/height</span>
  <span class="Constant">1</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[ </span>
<span class="Constant">recipe foo [</span>
<span class="Constant">  local-scope</span>
<span class="Constant">  x:number &lt;- copy 0</span>
<span class="Constant">  y:address:shared:point &lt;- new point:type</span>
<span class="Constant">  get *y:address:shared:point, x:number</span>
<span class="Constant">]</span>]
  <span class="Constant">2</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[foo]</span>
  <span class="Constant">3</span>:address:shared:programming-environment-data<span class="Special"> &lt;- </span>new-programming-environment screen:address:shared:screen, <span class="Constant">1</span>:address:shared:array:character, <span class="Constant">2</span>:address:shared:array:character
  assume-console [
    press F4
  ]
  run [
    event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
  ]
  screen-should-contain [
   <span class="Constant"> .  errors found                                                                   run (F4)           .</span>
   <span class="Constant"> .                                                  β”Šfoo                                              .</span>
   <span class="Constant"> .recipe foo [                                      β”Šβ”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”.</span>
   <span class="Constant"> .  local-scope                                     β”Š                                                 .</span>
   <span class="Constant"> .  x:number &lt;- copy 0                              β”Š                                                 .</span>
   <span class="Constant"> .  y:address:shared:point &lt;- new point:type        β”Š                                                 .</span>
   <span class="Constant"> .  get *y:address:shared:point, x:number           β”Š                                                 .</span>
   <span class="Constant"> .]                                                 β”Š                                                 .</span>
   <span class="Constant"> .foo: expected ingredient 1 of 'get' to have type β†©β”Š                                                 .</span>
   <span class="Constant"> .'offset'; got x:number                            β”Š                                                 .</span>
   <span class="Constant"> .foo: second ingredient of 'get' should have type β†©β”Š                                                 .</span>
   <span class="Constant"> .'offset', but got x:number                        β”Š                                                 .</span>
   <span class="Constant"> .β”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”Š                                                 .</span>
   <span class="Constant"> .                                                  β”Š                                                 .</span>
  ]
]

<span class="muScenario">scenario</span> run-shows-errors-everytime [
  trace-until <span class="Constant">100/app</span>  <span class="Comment"># trace too long</span>
  <span class="Comment"># try to run a file with an error</span>
  assume-screen <span class="Constant">100/width</span>, <span class="Constant">15/height</span>
  <span class="Constant">1</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[ </span>
<span class="Constant">recipe foo [</span>
<span class="Constant">  local-scope</span>
<span class="Constant">  x:number &lt;- copy y:number</span>
<span class="Constant">]</span>]
  <span class="Constant">2</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[foo]</span>
  <span class="Constant">3</span>:address:shared:programming-environment-data<span class="Special"> &lt;- </span>new-programming-environment screen:address:shared:screen, <span class="Constant">1</span>:address:shared:array:character, <span class="Constant">2</span>:address:shared:array:character
  assume-console [
    press F4
  ]
  event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
  screen-should-contain [
   <span class="Constant"> .  errors found                                                                   run (F4)           .</span>
   <span class="Constant"> .                                                  β”Šfoo                                              .</span>
   <span class="Constant"> .recipe foo [                                      β”Šβ”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”.</span>
   <span class="Constant"> .  local-scope                                     β”Š                                                 .</span>
   <span class="Constant"> .  x:number &lt;- copy y:number                       β”Š                                                 .</span>
   <span class="Constant"> .]                                                 β”Š                                                 .</span>
   <span class="Constant"> .foo: use before set: y                            β”Š                                                 .</span>
   <span class="Constant"> .β”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”Š                                                 .</span>
   <span class="Constant"> .                                                  β”Š                                                 .</span>
  ]
  <span class="Comment"># rerun the file, check for the same error</span>
  assume-console [
    press F4
  ]
  run [
    event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
  ]
  screen-should-contain [
   <span class="Constant"> .  errors found                                                                   run (F4)           .</span>
   <span class="Constant"> .                                                  β”Šfoo                                              .</span>
   <span class="Constant"> .recipe foo [                                      β”Šβ”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”.</span>
   <span class="Constant"> .  local-scope                                     β”Š                                                 .</span>
   <span class="Constant"> .  x:number &lt;- copy y:number                       β”Š                                                 .</span>
   <span class="Constant"> .]                                                 β”Š                                                 .</span>
   <span class="Constant"> .foo: use before set: y                            β”Š                                                 .</span>
   <span class="Constant"> .β”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”Š                                                 .</span>
   <span class="Constant"> .                                                  β”Š                                                 .</span>
  ]
]

<span class="muScenario">scenario</span> run-instruction-and-print-errors [
  trace-until <span class="Constant">100/app</span>  <span class="Comment"># trace too long</span>
  assume-screen <span class="Constant">100/width</span>, <span class="Constant">10/height</span>
  <span class="Comment"># left editor is empty</span>
  <span class="Constant">1</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[]</span>
  <span class="Comment"># right editor contains an illegal instruction</span>
  <span class="Constant">2</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[get 1234:number, foo:offset]</span>
  <span class="Constant">3</span>:address:shared:programming-environment-data<span class="Special"> &lt;- </span>new-programming-environment screen:address:shared:screen, <span class="Constant">1</span>:address:shared:array:character, <span class="Constant">2</span>:address:shared:array:character
  <span class="Comment"># run the code in the editors</span>
  assume-console [
    press F4
  ]
  run [
    event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
  ]
  <span class="Comment"># check that screen prints error message in red</span>
  screen-should-contain [
   <span class="Constant"> .  errors found (0)                                                               run (F4)           .</span>
   <span class="Constant"> .                                                  β”Š                                                 .</span>
<span class="Constant">    .β”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”Šβ”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”.</span>
   <span class="Constant"> .                                                  β”Š0                                               x.</span>
   <span class="Constant"> .                                                  β”Šget 1234:number, foo:offset                      .</span>
   <span class="Constant"> .                                                  β”Šunknown element foo in container number          .</span>
   <span class="Constant"> .                                                  β”Šfirst ingredient of 'get' should be a container,↩.</span>
   <span class="Constant"> .                                                  β”Š but got 1234:number                             .</span>
   <span class="Constant"> .                                                  β”Šβ”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”.</span>
   <span class="Constant"> .                                                  β”Š                                                 .</span>
  ]
  screen-should-contain-in-color <span class="Constant">7/white</span>, [
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                   get 1234:number, foo:offset                      .</span>
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                                                                    .</span>
  ]
  screen-should-contain-in-color <span class="Constant">1/red</span>, [
   <span class="Constant"> .  errors found (0)                                                                                  .</span>
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                   unknown element foo in container number          .</span>
   <span class="Constant"> .                                                   first ingredient of 'get' should be a container, .</span>
   <span class="Constant"> .                                                    but got 1234:number                             .</span>
   <span class="Constant"> .                                                                                                    .</span>
  ]
  screen-should-contain-in-color <span class="Constant">245/grey</span>, [
   <span class="Constant"> .                                                                                                    .</span>
   <span class="Constant"> .                                                  β”Š                                                 .</span>
<span class="Constant">    .β”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”Šβ”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”.</span>
   <span class="Constant"> .                                                  β”Š                                                x.</span>
   <span class="Constant"> .                                                  β”Š                                                 .</span>
   <span class="Constant"> .                                                  β”Š                                                 .</span>
   <span class="Constant"> .                                                  β”Š                                                ↩.</span>
   <span class="Constant"> .                                                  β”Š                                                 .</span>
   <span class="Constant"> .                                                  β”Šβ”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”.</span>
   <span class="Constant"> .                                                  β”Š                                                 .</span>
  ]
]

<span class="muScenario">scenario</span> run-instruction-and-print-errors-only-once [
  trace-until <span class="Constant">100/app</span>  <span class="Comment"># trace too long</span>
  assume-screen <span class="Constant">100/width</span>, <span class="Constant">10/height</span>
  <span class="Comment"># left editor is empty</span>
  <span class="Constant">1</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[]</span>
  <span class="Comment"># right editor contains an illegal instruction</span>
  <span class="Constant">2</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[get 1234:number, foo:offset]</span>
  <span class="Constant">3</span>:address:shared:programming-environment-data<span class="Special"> &lt;- </span>new-programming-environment screen:address:shared:screen, <span class="Constant">1</span>:address:shared:array:character, <span class="Constant">2</span>:address:shared:array:character
  <span class="Comment"># run the code in the editors multiple times</span>
  assume-console [
    press F4
    press F4
  ]
  run [
    event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
  ]
  <span class="Comment"># check that screen prints error message just once</span>
  screen-should-contain [
   <span class="Constant"> .  errors found (0)                                                               run (F4)           .</span>
   <span class="Constant"> .                                                  β”Š                                                 .</span>
<span class="Constant">    .β”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”Šβ”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”.</span>
   <span class="Constant"> .                                                  β”Š0                                               x.</span>
   <span class="Constant"> .                                                  β”Šget 1234:number, foo:offset                      .</span>
   <span class="Constant"> .                                                  β”Šunknown element foo in container number          .</span>
   <span class="Constant"> .                                                  β”Šfirst ingredient of 'get' should be a container,↩.</span>
   <span class="Constant"> .                                                  β”Š but got 1234:number                             .</span>
   <span class="Constant"> .                                                  β”Šβ”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”.</span>
   <span class="Constant"> .                                                  β”Š                                                 .</span>
  ]
]

<span class="muScenario">scenario</span> sandbox-can-handle-infinite-loop [
  trace-until <span class="Constant">100/app</span>  <span class="Comment"># trace too long</span>
  assume-screen <span class="Constant">100/width</span>, <span class="Constant">20/height</span>
  <span class="Comment"># left editor is empty</span>
  <span class="Constant">1</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[recipe foo [</span>
<span class="Constant">  {</span>
<span class="Constant">    loop</span>
<span class="Constant">  }</span>
<span class="Constant">]</span>]
  <span class="Comment"># right editor contains an instruction</span>
  <span class="Constant">2</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[foo]</span>
  <span class="Constant">3</span>:address:shared:programming-environment-data<span class="Special"> &lt;- </span>new-programming-environment screen:address:shared:screen, <span class="Constant">1</span>:address:shared:array:character, <span class="Constant">2</span>:address:shared:array:character
  <span class="Comment"># run the sandbox</span>
  assume-console [
    press F4
  ]
  run [
    event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
  ]
  screen-should-contain [
   <span class="Constant"> .  errors found (0)                                                               run (F4)           .</span>
   <span class="Constant"> .recipe foo [                                      β”Š                                                 .</span>
   <span class="Constant"> .  {                                               β”Šβ”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”.</span>
   <span class="Constant"> .    loop                                          β”Š0                                               x.</span>
   <span class="Constant"> .  }                                               β”Šfoo                                              .</span>
   <span class="Constant"> .]                                                 β”Štook too long!                                   .</span>
<span class="Constant">    .β”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”Šβ”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”.</span>
   <span class="Constant"> .                                                  β”Š                                                 .</span>
  ]
]

<span class="muScenario">scenario</span> sandbox-with-errors-shows-trace [
  trace-until <span class="Constant">100/app</span>  <span class="Comment"># trace too long</span>
  assume-screen <span class="Constant">100/width</span>, <span class="Constant">10/height</span>
  <span class="Comment"># generate a stash and a error</span>
  <span class="Constant">1</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[recipe foo [</span>
<span class="Constant">local-scope</span>
<span class="Constant">a:number &lt;- next-ingredient</span>
<span class="Constant">b:number &lt;- next-ingredient</span>
<span class="Constant">stash [dividing by]</span>, b
_, c:number<span class="Special"> &lt;- </span>divide-with-remainder a, b
<span class="muControl">reply</span> b
]]
  <span class="Constant">2</span>:address:shared:array:character<span class="Special"> &lt;- </span>new <span class="Constant">[foo 4, 0]</span>
  <span class="Constant">3</span>:address:shared:programming-environment-data<span class="Special"> &lt;- </span>new-programming-environment screen:address:shared:screen, <span class="Constant">1</span>:address:shared:array:character, <span class="Constant">2</span>:address:shared:array:character
  <span class="Comment"># run</span>
  assume-console [
    press F4
  ]
  event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
  <span class="Comment"># screen prints error message</span>
  screen-should-contain [
   <span class="Constant"> .  errors found (0)                                                               run (F4)           .</span>
   <span class="Constant"> .recipe foo [                                      β”Š                                                 .</span>
   <span class="Constant"> .local-scope                                       β”Šβ”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”.</span>
   <span class="Constant"> .a:number &lt;- next-ingredient                       β”Š0                                               x.</span>
   <span class="Constant"> .b:number &lt;- next-ingredient                       β”Šfoo 4, 0                                         .</span>
   <span class="Constant"> .stash [dividing by], b                            β”Šfoo: divide by zero in '_, c:number &lt;- divide-wi↩.</span>
   <span class="Constant"> ._, c:number &lt;- divide-with-remainder a, b         β”Šth-remainder a, b'                               .</span>
   <span class="Constant"> .reply b                                           β”Šβ”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”.</span>
   <span class="Constant"> .]                                                 β”Š                                                 .</span>
  ]
  <span class="Comment"># click on the call in the sandbox</span>
  assume-console [
    left-click <span class="Constant">4</span>, <span class="Constant">55</span>
  ]
  run [
    event-loop screen:address:shared:screen, console:address:shared:console, <span class="Constant">3</span>:address:shared:programming-environment-data
  ]
  <span class="Comment"># screen should expand trace</span>
  screen-should-contain [
   <span class="Constant"> .  errors found (0)                                                               run (F4)           .</span>
   <span class="Constant"> .recipe foo [                                      β”Š                                                 .</span>
   <span class="Constant"> .local-scope                                       β”Šβ”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”.</span>
   <span class="Constant"> .a:number &lt;- next-ingredient                       β”Š0                                               x.</span>
   <span class="Constant"> .b:number &lt;- next-ingredient                       β”Šfoo 4, 0                                         .</span>
   <span class="Constant"> .stash [dividing by], b                            β”Šdividing by 0                                    .</span>
   <span class="Constant"> ._, c:number &lt;- divide-with-remainder a, b         β”Šfoo: divide by zero in '_, c:number &lt;- divide-wi↩.</span>
   <span class="Constant"> .reply b                                           β”Šth-remainder a, b'                               .</span>
   <span class="Constant"> .]                                                 β”Šβ”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”.</span>
  ]
]
</pre>
</body>
</html>
<!-- vim: set foldmethod=manual : -->