• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mattwparas / steel / 18461079395

13 Oct 2025 09:20AM UTC coverage: 42.731% (-0.9%) from 43.668%
18461079395

Pull #536

github

web-flow
Merge 6f55a8b56 into e378cba22
Pull Request #536: Initial proposal for no_std support

63 of 755 new or added lines in 38 files covered. (8.34%)

73 existing lines in 15 files now uncovered.

12324 of 28841 relevant lines covered (42.73%)

3215759.81 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/crates/steel-core/tests/portable.rs
1
#![allow(dead_code)]
2

3
use steel::steel_vm::engine::Engine;
4
use steel::SteelVal;
5

6
/// Basic regression: calling a function after a top-level error should succeed once redefined.
NEW
7
pub fn top_level_error_allows_redefining() {
×
NEW
8
    let mut evaluator = Engine::new();
×
9

NEW
10
    evaluator
×
11
        .run("(define (x) (- x 2))")
12
        .expect("initial definition should succeed");
13

NEW
14
    evaluator
×
15
        .run("(x)")
16
        .expect_err("invoking the function before redefining should fail");
17

NEW
18
    evaluator
×
19
        .run("(define (x) (- x 2))")
20
        .expect("redefinition after an error should succeed");
21
}
22

23
/// Ensure mutations of primitive procedures can be observed immediately.
NEW
24
pub fn redefinition_of_values_over_time() {
×
NEW
25
    let mut vm = Engine::new();
×
26

NEW
27
    vm.compile_and_run_raw_program("(define + -)")
×
28
        .expect("redefinition should succeed");
NEW
29
    let res = vm
×
30
        .compile_and_run_raw_program("(+ 10 20)")
31
        .expect("invocation should succeed");
32

NEW
33
    assert_eq!(res.first(), Some(&SteelVal::IntV(-10)));
×
34
}
35

36
/// Verify redefining constant evaluation functions is reflected immediately.
NEW
37
pub fn redefinition_of_functions_for_constant_evaluation() {
×
NEW
38
    let mut vm = Engine::new();
×
39

NEW
40
    vm.compile_and_run_raw_program("(define foo-bar (lambda (x y) (+ x y)))")
×
41
        .expect("initial definition should succeed");
NEW
42
    let res = vm
×
43
        .compile_and_run_raw_program("(foo-bar 10 20)")
44
        .expect("call should succeed");
NEW
45
    assert_eq!(res.first(), Some(&SteelVal::IntV(30)));
×
46

NEW
47
    vm.compile_and_run_raw_program("(define foo-bar (lambda (x y) (#%black-box) (- x y)))")
×
48
        .expect("redefinition should succeed");
NEW
49
    let res = vm
×
50
        .compile_and_run_raw_program("(foo-bar 10 20)")
51
        .expect("call after redefinition should succeed");
NEW
52
    assert_eq!(res.first(), Some(&SteelVal::IntV(-10)));
×
53
}
54

55
/// Small arithmetic sanity check to ensure the interpreter can evaluate simple programs.
NEW
56
pub fn arithmetic_smoke_test() {
×
NEW
57
    let mut vm = Engine::new();
×
NEW
58
    let result = vm
×
59
        .compile_and_run_raw_program("(+ 1 2 3 4)")
60
        .expect("program should run");
61

NEW
62
    assert_eq!(result.first(), Some(&SteelVal::IntV(10)));
×
63
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc