~/bend-docscommunity

src/ez/quiet.bend checks

raw source on the hub · import 0x74799d3f846634a3d7461d4336d7c9d4/src/ez/quiet.bend as Quiet

ez/quiet: bend's own chatter dropped from a run's output, so a test sees only what its program printed. Since 2.0.32 bend prints no check report in front of a program it runs: a verdict (ALL PROOFS CHECK or SOME PROOFS FAIL) is printed only for a file with no main, and a run that fails its check fails the test on what it printed, which is kept. The report lines older releases printed in front of every run are no longer dropped.

bend also nags about its own updates: bend 2.0.21 is available: run bend update, printed whenever a newer release exists and the network can be reached. That line is not the program's output either, and leaving it in fails every test in the tree the day upstream cuts a release. It is worth being precise about how bad that is: the gate went from green to 33 of 52 here without a line of ez changing, and it did it the moment a laptop regained its network, so it is invisible offline and arrives looking like a regression someone just introduced. It is dropped.

1 import
import Base

Types

type Tail source · line 27 · raw

Data

a trailing run of blank lines, being dropped from the right. live turns true at the first line that survives, after which nothing is dropped.

Definitions

def is_nag source · line 21 · raw

@+line:String -> Bool

whether this line is bend telling us a newer bend exists. Anchored at both ends rather than matched loosely: a test that legitimately prints the words bend update in prose should still be compared on them.

def put source · line 31 · raw

@drop:Bool -> @line:String -> @rest:List<&2, String> -> List<&2, String>

a line kept or dropped

def go source · line 39 · raw

@ls:List<&2, String> -> List<&2, String>

the lines with the nag dropped

def tail.blank source · line 48 · raw

@live:Bool -> @out:List<&2, String> -> Tail

a blank line: kept once something after it has survived, dropped while the run of trailing blanks is still open

def tail.line source · line 57 · raw

@line:String -> @live:Bool -> @out:List<&2, String> -> Tail

one line offered to the tail. The line is taken apart rather than asked about, because a fold's step may not declare a + parameter to duplicate it.

def tail.step source · line 65 · raw

@line:String -> @st:Tail -> Tail

a fold from the right: until a line survives, a blank one is dropped

def tail.out source · line 70 · raw

@st:Tail -> List<&2, String>

what a finished fold collected

def tail.walk source · line 76 · raw

@ls:List<&2, String> -> Tail

the fold from the right, written out. Base's List.foldr takes its step as an erased argument, and the termination check cannot read through one.

def chomp.lines source · line 85 · raw

@ls:List<&2, String> -> List<&2, String>

the lines with the blank ones at the end dropped, the way a shell's $(...) drops a trailing newline, so a comparison never turns on one

def chomp source · line 89 · raw

@text:String -> String

the text with its trailing blank lines dropped

def filter source · line 94 · raw

@text:String -> String

a run's output as a test's #| trailer states it: no update nag, no trailing newline