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

TyRoXx / NonlocalityOS / 14802780313

02 May 2025 08:24PM UTC coverage: 72.953% (-4.9%) from 77.804%
14802780313

Pull #231

github

web-flow
Merge 35eb1dcbf into edae0862b
Pull Request #231: Remove some useless mod tests

846 of 898 new or added lines in 12 files covered. (94.21%)

11 existing lines in 4 files now uncovered.

3056 of 4189 relevant lines covered (72.95%)

2246.3 hits per line

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

0.0
/lambda/src/hello_world_tests.rs
1
use crate::{
2
    expressions::{evaluate, DeepExpression, Expression, PrintExpression, ReadVariable},
3
    name::{Name, NamespaceId},
4
};
5
use astraea::{
6
    storage::{InMemoryValueStorage, LoadValue, StoreValue},
7
    tree::{BlobDigest, HashedValue, Value},
8
};
9
use std::{pin::Pin, sync::Arc};
10

11
#[test_log::test(tokio::test)]
12
async fn hello_world() {
13
    let storage = Arc::new(InMemoryValueStorage::empty());
14
    let namespace = NamespaceId([42; 16]);
15
    let hello_world_string = Arc::new(Value::from_string("Hello, world!\n").unwrap());
16
    let hello_world_string_ref = storage
17
        .store_value(&HashedValue::from(hello_world_string))
18
        .await
19
        .unwrap();
20
    let console_output = crate::standard_library::ConsoleOutput {
21
        message: hello_world_string_ref,
22
    };
23
    let console_output_value = Arc::new(console_output.to_value());
24
    let console_output_expression = DeepExpression(Expression::make_literal(
25
        storage
26
            .store_value(&HashedValue::from(console_output_value.clone()))
27
            .await
28
            .unwrap(),
29
    ));
30
    let lambda_parameter_name = Name::new(namespace, "unused_arg".to_string());
31
    let lambda_expression = DeepExpression(Expression::make_lambda(
32
        lambda_parameter_name.clone(),
33
        Arc::new(console_output_expression),
34
    ));
35
    {
36
        let mut program_as_string = String::new();
37
        lambda_expression
38
            .0
39
            .print(&mut program_as_string, 0)
40
            .unwrap();
41
        assert_eq!(
42
            concat!(
43
            "(2a2a2a2a-2a2a-2a2a-2a2a-2a2a2a2a2a2a.unused_arg) =>\n",
44
            "  literal(09e593654f7d4be82ed8ef897a98f0c23c45d5b49ec58a5c8e9df679bf204e0bd2d7b184002cf1348726dfc5ae6d25a5ce57b36177839f474388486aa27f5ece)"),
45
            program_as_string.as_str()
46
        );
47
    }
48
    let read_variable: Arc<ReadVariable> = Arc::new(
UNCOV
49
        move |_name: &Name| -> Pin<Box<dyn core::future::Future<Output = BlobDigest> + Send>> {
×
UNCOV
50
            todo!()
×
51
        },
52
    );
53
    let main_function = evaluate(&lambda_expression, &*storage, &*storage, &read_variable)
54
        .await
55
        .unwrap();
56
    let call_main = DeepExpression(Expression::make_apply(
57
        Arc::new(DeepExpression(Expression::make_literal(main_function))),
58
        Arc::new(DeepExpression(Expression::make_literal(
59
            storage
60
                .store_value(&HashedValue::from(Arc::new(Value::empty())))
61
                .await
62
                .unwrap(),
63
        ))),
64
    ));
65
    let main_result = evaluate(&call_main, &*storage, &*storage, &read_variable)
66
        .await
67
        .unwrap();
68
    let serialized_result = storage
69
        .load_value(&main_result)
70
        .await
71
        .unwrap()
72
        .hash()
73
        .unwrap();
74
    let deserialized_result =
75
        crate::standard_library::ConsoleOutput::from_value(serialized_result.value()).unwrap();
76
    assert_eq!(&console_output, &deserialized_result);
77
}
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

© 2026 Coveralls, Inc