Skip to content

Commit

Permalink
Support non-scalar variables in test local built-in
Browse files Browse the repository at this point in the history
  • Loading branch information
magicant committed Jul 9, 2024
1 parent dc0779e commit e70f6b3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions yash-semantics/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ use yash_env::semantics::ExitStatus;
use yash_env::semantics::Field;
use yash_env::system::r#virtual::SIGSTOP;
use yash_env::system::Errno;
use yash_env::variable::Scalar;
use yash_env::variable::Scope;
use yash_env::Env;
use yash_env::System;
Expand Down Expand Up @@ -158,8 +157,8 @@ fn local_builtin_main(
} else {
let name = value;
if let Some(var) = env.variables.get(&name) {
if let Some(Scalar(value)) = &var.value {
let line = format!("{name}={value}\n");
if let Some(value) = &var.value {
let line = format!("{name}={}\n", value.quote());
if let Err(errno) = env.system.write_all(Fd::STDOUT, line.as_bytes()).await
{
unimplemented!("write error: {:?}", errno);
Expand Down

0 comments on commit e70f6b3

Please sign in to comment.