Skip to content

Commit

Permalink
Attempt to unbork VarDeclaration::Constant tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Mar 5, 2023
1 parent 6c3468c commit b3d704f
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions t/12-rakuast/var.rakutest
Expand Up @@ -983,22 +983,27 @@ subtest 'Lexical constant' => {
# constant foo = "bar"
ast RakuAST::Statement::Expression.new(
expression => RakuAST::VarDeclaration::Constant.new(
name => "foo",
value => "bar"
name => "foo",
initializer => RakuAST::StrLiteral.new("bar")
)
);
is-deeply $deparsed, 'constant foo = "bar"', 'deparse';
is-deeply $_, "bar", @type[$++]
for EVAL($ast), EVAL($deparsed);
package one {
todo "WTF";
is-deeply EVAL($ast), "bar", @type[$++];
}
package two {
is-deeply EVAL($deparsed), "bar", @type[$++];
}
}

subtest 'Lexical my constant' => {
# my constant foo = "bar"
ast RakuAST::Statement::Expression.new(
expression => RakuAST::VarDeclaration::Constant.new(
scope => "my",
name => "foo",
value => "bar"
scope => "my",
name => "foo",
initializer => RakuAST::StrLiteral.new("bar")
)
);
is-deeply $deparsed, 'my constant foo = "bar"', 'deparse';
Expand Down

0 comments on commit b3d704f

Please sign in to comment.