8000 lib tests with standalone lurkscript by porcuquine · Pull Request #432 · lurk-lab/lurk · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

lib tests with standalone lurkscript #432

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/struct.ls
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def(alistStruct, function (fields) {
return function (op) {
if (op === 'new'.key) {
return function (vals) {
const alist = emit(zip(fields, vals));
const alist = zip(fields, vals);
field => cdr(assoc(field, alist))
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/struct.lurk
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
;; However this allows an interface that abstracts the implementation.
(if (eq op :new)
(lambda (vals)
(let ((alist (emit (zip fields vals))))
(let ((alist (zip fields vals)))
(lambda (field)
(cdr (assoc field alist)))))))))

Expand Down
2 changes: 1 addition & 1 deletion lib/util-test.ls
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ load.meta('util.ls')
assertError(todo(restOfOwl.key))

// error
assertError(error(nasty.key, 123))
assertError(error(nasty.key))

// assert
// FIXME: This requires #422 to be fixed.
Expand Down
2 changes: 1 addition & 1 deletion lib/util-test.lurk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
!(assert-error (todo :rest-of-owl))

;; error
!(assert-error (error :nasty 123))
!(assert-error (error :nasty))

;; assert_
!(assert-eq 9 (assert_ 9))
Expand Down
4 changes: 2 additions & 2 deletions lib/util.ls
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ def(todo, x => { emit(list(todo.key, x));
BREAK()
})

def(error, data => {
emit(list(error.key, data))
def(err, data => {
emit(list(error.key, data));
// this will error
BREAK()
})
Expand Down
14 changes: 14 additions & 0 deletions src/core/cli/tests/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::process::Command;

use crate::core::cli::{
config::{set_config_if_unset, Config},
repl::Repl,
Expand Down Expand Up @@ -48,6 +50,18 @@ fn test_lib_ls() {
assert!(repl.load_file("lib/tests.ls".into(), false).is_ok());
}

#[ignore]
#[test]
fn test_lib_ls_lurkscript() {
set_config_if_unset(Config::default());
let output = Command::new("lurkscript")
.arg("lib/tests.ls")
.output()
.unwrap();

assert!(output.status.success());
}

#[ignore]
#[test]
fn test_demo_files() {
Expand Down
Loading
0