Permalink
Browse files

switch back to test JSON from PGE

  • Loading branch information...
1 parent 394f955 commit 938ab0e8cc73effd50e5b214206119ea4e3b589b Gerd Pokorra committed Mar 7, 2011
Showing with 11 additions and 7 deletions.
  1. +11 −7 t/compilers/data_json/to_parrot.t
@@ -690,11 +690,13 @@ sub json_dump_is {
return pir_output_is( <<"END_PIR", $dumped, $reason, %args );
.sub test :main
- load_language 'JSON'
+ load_language 'data_json'
load_bytecode 'dumper.pbc'
- .local pmc result
- result = from_json("$code")
+ .local pmc JSON, eval, result
+ JSON = compreg 'data_json'
+ eval = JSON.'compile'("$code")
+ result = eval()
_dumper(result, "JSON")
.end
END_PIR
@@ -707,14 +709,16 @@ sub json_isnt {
$code =~ s{("|\\)}{\\$1}g;
$code =~ s{\n}{\\n}g;
- return pir_error_output_like( <<"END_PIR", qr/Unable to parse source/, $reason, %args );
+ return pir_error_output_like( <<"END_PIR", qr/not a valid JSON value/, $reason, %args );
@cotto

cotto Mar 7, 2011

Contributor

We should avoid testing against specific error messages. What about just testing that the compile fails?

.sub test :main
- load_language 'JSON'
+ load_language 'data_json'
- .local pmc result
+ .local pmc JSON, eval, result
- result = from_json("$code")
+ JSON = compreg 'data_json'
+ eval = JSON.'compile'("$code")
+ result = eval()
.end
END_PIR

0 comments on commit 938ab0e

Please sign in to comment.