From 368a71522d2a8715a4a53fd021e299efbf7ceb62 Mon Sep 17 00:00:00 2001 From: ghostly_zsh Date: Fri, 9 Aug 2024 18:32:54 -0500 Subject: [PATCH] fix tests --- kabel/test/runtime/turbo_oop.kab | 26 -------------------------- kabel/test/runtime/turbo_oop.out | 0 kabel/test/syntax/assignment.out | 15 +++++++++------ kabel/test/syntax/if_else.out | 15 +++++++++------ 4 files changed, 18 insertions(+), 38 deletions(-) delete mode 100644 kabel/test/runtime/turbo_oop.kab delete mode 100644 kabel/test/runtime/turbo_oop.out diff --git a/kabel/test/runtime/turbo_oop.kab b/kabel/test/runtime/turbo_oop.kab deleted file mode 100644 index 777d5c7b09d156d86da479d21180a9b4e5f77910..0000000000000000000000000000000000000000 --- a/kabel/test/runtime/turbo_oop.kab +++ /dev/null @@ -1,26 +0,0 @@ -// modules.select(type, group ...) -// -// select all super thrusters that are in both the 'forward' and -// 'lowpoweronly' user-defined groups -// -// 'forward' and 'lowpoweronly' are vecs of modules that have -// been tagged in the ship editor as such - -function sleep(h) {} - -var lp_forwards = modules.select(modules.types.SuperThruster, "forward", "lowpoweronly"); -var sensors = modules.select(modules.types.ShipProximitySensor); - -loop { - // yes, i think we need 'loop' - while True - // may confuse beginners - - sleep(1); // 1 second - - // if something is less than 15u away, - if (sensors.read() < 15) { - lp_forwards.activate(); - } else { - lp_forwards.off(); // alias of Module.deactivate - } -} diff --git a/kabel/test/runtime/turbo_oop.out b/kabel/test/runtime/turbo_oop.out deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/kabel/test/syntax/assignment.out b/kabel/test/syntax/assignment.out index 3e52f6e9268b2925f24edb712fce187d842e99a7..44732e1230001d16b49ba0c4f7e325437b821be6 100644 --- a/kabel/test/syntax/assignment.out +++ b/kabel/test/syntax/assignment.out @@ -1,7 +1,10 @@ Program -| Decl i -| | Lit 0 -| Assign i -| | Lit string -| Decl _foo -| | Lit 3 +| Expr +| | Decl i +| | | Lit 0 +| Expr +| | Assign i +| | | Lit string +| Expr +| | Decl _foo +| | | Lit 3 diff --git a/kabel/test/syntax/if_else.out b/kabel/test/syntax/if_else.out index 43aa2ab57fc092414b6ea47352406a89f11b9c3d..e6a156ba5b721643105866707d80116ee81ebfee 100644 --- a/kabel/test/syntax/if_else.out +++ b/kabel/test/syntax/if_else.out @@ -4,17 +4,20 @@ Program | | | Lit i | | | Lit 0 | | Block -| | | Assign i -| | | | Lit 1 +| | | Expr +| | | | Assign i +| | | | | Lit 1 | Else | | If | | | Binary Eq | | | | Lit i | | | | Lit 1 | | | Block -| | | | Assign i -| | | | | Lit 2 +| | | | Expr +| | | | | Assign i +| | | | | | Lit 2 | | Else | | | Block -| | | | Assign i -| | | | | Lit 3 +| | | | Expr +| | | | | Assign i +| | | | | | Lit 3