Skip to content

Commit 7a5e425

Browse files
committed
test(WO80/A4): rulings for run dispatch and the to-directive gap
run cross-map dispatch via dependency aliases verified (onetwo). The to upcase directive is UNIMPLEMENTED in the ISC interpreter (raises for both literal and any-class froms) -- the corpus's rus map exercises it only through the legacy path. IS-1 v2 must specify or scope it out (the A4 decision). The WO80 capability findings now have three motivating cases.
1 parent 784b5cc commit 7a5e425

1 file changed

Lines changed: 69 additions & 0 deletions

File tree

‎spec/isc/semantics_spec.rb‎

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,3 +139,72 @@ def context_map(id, rule)
139139
end
140140
end
141141
end
142+
143+
RSpec.describe "ISC semantics — run and to-directives" do
144+
def with_map(name, body)
145+
dir = Dir.mktmpdir
146+
File.write(File.join(dir, name), body)
147+
Interscript.load_path.unshift(dir)
148+
yield
149+
ensure
150+
Interscript.load_path.delete(dir) if dir
151+
end
152+
153+
it "rules: run dispatches to a dependency-aliased cross-map stage" do
154+
lib = <<~ISC
155+
system "TST:xx-Latn:Latn:22" {
156+
metadata {
157+
authority_id tst
158+
id 22
159+
language iso-639-2:xx
160+
source_script Latn
161+
destination_script Latn
162+
}
163+
stage main { parallel { sub "1" "one" } }
164+
}
165+
ISC
166+
runner = <<~ISC
167+
system "TST:xx-Latn:Latn:23" {
168+
metadata {
169+
authority_id tst
170+
id 23
171+
language iso-639-2:xx
172+
source_script Latn
173+
destination_script Latn
174+
}
175+
dependency "tst-lib-1" as lib
176+
stage main {
177+
run map.lib.stage.main
178+
parallel { sub "2" "two" }
179+
}
180+
}
181+
ISC
182+
with_map("tst-lib-1.isc", lib) do
183+
with_map("tst-run-1.isc", runner) do
184+
expect(Interscript.transliterate("tst-run-1", "12")).to eq("onetwo")
185+
end
186+
end
187+
end
188+
189+
it "rules: the to upcase directive is unimplemented in the ISC interpreter (WO80)" do
190+
# The corpus's rus map exercises `to upcase` via the legacy path; the
191+
# ISC executor raises on the directive for both literal and any-class
192+
# froms. IS-1 v2 must either specify the directive or scope it out
193+
# for the ISC engine (the A4 decision).
194+
with_map("tst-up-1.isc", <<~ISC) do
195+
system "TST:xx-Latn:Latn:21" {
196+
metadata {
197+
authority_id tst
198+
id 21
199+
language iso-639-2:xx
200+
source_script Latn
201+
destination_script Latn
202+
}
203+
stage main { parallel { sub { from any("a".."c") to upcase } } }
204+
}
205+
ISC
206+
expect { Interscript.transliterate("tst-up-1", "abc") }
207+
.to raise_error(NoMethodError, /nth_string/)
208+
end
209+
end
210+
end

0 commit comments

Comments
 (0)