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

source-academy / py-slang / 23832539647

01 Apr 2026 04:52AM UTC coverage: 63.539% (+2.9%) from 60.609%
23832539647

Pull #129

github

web-flow
Merge ac048b8c6 into e4df6e2f4
Pull Request #129: Add new standard library functions

794 of 1459 branches covered (54.42%)

Branch coverage included in aggregate %.

79 of 121 new or added lines in 9 files covered. (65.29%)

4 existing lines in 3 files now uncovered.

2599 of 3881 relevant lines covered (66.97%)

3522.92 hits per line

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

70.0
/src/stdlib/stream.ts
1
import { Context } from "../cse-machine/context";
2
import { ControlItem } from "../cse-machine/control";
3
import { BuiltinValue, ListValue, NoneValue, Value } from "../cse-machine/stash";
4
import { minArgMap, Validate } from "../stdlib";
1✔
5
import streamPrelude from "./stream.prelude";
1✔
6
import { Group, GroupName } from "./utils";
1✔
7

8
const streamBuiltins = new Map<string, BuiltinValue>();
1✔
9

10
class StreamBuiltins {
11
  @Validate(0, null, "stream", true)
12
  static stream(
1✔
13
    args: Value[],
14
    source: string,
15
    command: ControlItem,
16
    context: Context,
17
  ): ListValue | NoneValue {
18
    if (args.length === 0) {
×
19
      return { type: "none" };
×
20
    }
21
    const head = args[0];
×
22
    return {
×
23
      type: "list",
24
      value: [
25
        head,
26
        {
27
          type: "builtin",
28
          name: "anonymous stream",
29
          minArgs: 0,
UNCOV
30
          func: () => StreamBuiltins.stream(args.slice(1), source, command, context),
×
31
        },
32
      ],
33
    };
34
  }
35
}
36
for (const builtin of Object.getOwnPropertyNames(StreamBuiltins)) {
1✔
37
  if (
4✔
38
    typeof StreamBuiltins[builtin as keyof typeof StreamBuiltins] === "function" &&
5✔
39
    !builtin.startsWith("_")
40
  ) {
41
    streamBuiltins.set(builtin, {
1✔
42
      type: "builtin",
43
      func: StreamBuiltins[builtin as keyof typeof StreamBuiltins] as BuiltinValue["func"],
44
      name: builtin,
45
      minArgs: minArgMap.get(builtin) || 0,
2✔
46
    });
47
  }
48
}
49
export default {
1✔
50
  name: GroupName.STREAMS,
51
  prelude: streamPrelude,
52
  builtins: streamBuiltins,
53
} as Group;
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