Skip to content
Closed
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
28 changes: 3 additions & 25 deletions specs/t27mcp/examples.t27
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@

module T27mcpExamples;

// find() and has() are check_hints.t27's; t27c gen inlines them into examples.wasm.
use t27mcp::check_hints::{find, has};

/// The commit of gHashTag/t27 every row points into.
pub const PIN : str = "a18d7ee14a9994ef9dc84dac10e1a2944367d4c5";

Expand Down Expand Up @@ -82,31 +85,6 @@ pub const EX_WHY : [10]str = [
"The header states that nothing here is reset: the counters start from their var initialisers."
];

/// Byte offset of the first occurrence of `needle` in `hay`, or NO_POS.
pub fn find(hay: string, needle: string) -> u32 {
var hn : u32 = (hay.len as u32);
var nn : u32 = (needle.len as u32);
if (nn > hn) { return NO_POS; }
var i : u32 = 0;
while (i <= hn - nn) {
var j : u32 = 0;
var same : u32 = 1;
while (j < nn) {
if ((hay[i + j] as u32) != (needle[j] as u32)) { same = 0; }
j = j + 1;
}
if (same == 1) { return i; }
i = i + 1;
}
return NO_POS;
}

/// 1 when `needle` occurs in `hay`.
pub fn has(hay: string, needle: string) -> u32 {
if (find(hay, needle) == NO_POS) { return 0; }
return 1;
}

/// The topic a lower-case question is about, or T_NONE.
pub fn topic_code(q: string) -> u32 {
if (has(q, "reset") == 1) {
Expand Down
4 changes: 2 additions & 2 deletions tools/census/quiet.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
GATE STEPS WHOSE PASS SURVIVES THE SUBJECT GOING MISSING

workflow files read 66
workflow files read 67
steps in a quiet shape 32
named a path but not quiet 198 (--excluded prints them)
named a path but not quiet 200 (--excluded prints them)

by shape:
failure branch passes 14 `… 2>/dev/null … || echo PASSED`
Expand Down
8 changes: 4 additions & 4 deletions tools/census/shell.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
WHICH INTERPRETER EACH GATE STEP IS HANDED TO, AND WHO SAYS SO

workflow files read 66
jobs 87
run: steps 313
workflow files read 67
jobs 88
run: steps 314

who names the shell:
the runner does 292 no container, so bash -eo pipefail
the runner does 293 no container, so bash -eo pipefail
a `shell:` key does 6
NOBODY 15 a container and no `shell:` key

Expand Down
Loading