Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module v2.test.parse.parse_acceptance_census
module test.claim.parse_test_parse_acceptance_census

import v2.compiler.parse_acceptance_census { parse_acceptance_of_text }
import v2.std.live_tree { LiveTreeDisposition, SubstrateInputsOnly }
Expand All @@ -10,15 +10,19 @@ data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly
// reports `accepted`, `refused <fatal reason> <start>..<end>`, or `unreadable`; everything but the read
// is parse_acceptance_of_text, a pure function of the text. These claims supply the text (DESIGN
// section 3: the input belongs at the interface as a supplied value) and pin the exact line the census
// prints for each arm a grammar comparison reads: a block-headed operand accepted, and a refusal named
// by its typed reason at its byte range. The read is the hand-run entry the module header names.
// prints for each arm: an accepted module, and a refusal named by its typed reason at its byte range.
// The read is the hand-run entry the module header names. The accepted text is the smallest module
// with one declaration, because WHICH construct is accepted is not this claim's subject: a
// block-headed operand accepted through this same route is held by
// test.claim.parse_test_block_headed_operand_class
// a_block_headed_left_operand_parses_on_the_real_module_route_holds.

data census_accepted_source: String = "module probe.census_ok\n\ndata d: Int = match w {\n _ => 1\n} + 2\n"
data census_accepted_source: String = "module p\ndata d: Int = 1\n"

// The `-` that begins the last line is at bytes 45..46.
data census_refused_source: String = "module probe.census_refused\n\ndata d: Int = x\n- 1\n"

test fn the_census_reports_a_block_headed_operand_accepted_holds() -> Bool {
test fn the_census_reports_an_accepted_module_holds() -> Bool {
parse_acceptance_of_text(text: census_accepted_source, path: "probe/census_ok.dag") == "accepted"
}

Expand Down