ketos 0.5.0

Lisp dialect scripting and extension language
Documentation
extern crate ketos;

use ketos::{Error, Interpreter};

use std::fs::read_dir;
use std::path::{Path, PathBuf};

fn run_file(path: &Path) -> Result<(), Error> {
    let interp = Interpreter::with_search_paths(vec![PathBuf::from("lib")]);

    interp.run_file(path)
}

// Runs all the tests matching `lib/test-*.ket`
#[test]
fn test_run() {
    let dir = read_dir("lib").expect("failed to read dir");

    for ent in dir {
        let ent = ent.expect("failed to read dir entry");
        let fname = ent.file_name();
        let name = fname.to_str().expect("failed to convert filename to string");

        if name.starts_with("test-") && name.ends_with(".ket") {
            run_file(&ent.path()).unwrap();
        }
    }
}