Skip to content

Commit

Permalink
Remove test for removed internal behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
doonv committed Jan 3, 2024
1 parent 0f8256e commit 5d12435
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/builtin_parser/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ pub fn run(ast: Ast, world: &mut World) {
match value {
Ok(Value::None) => {}
Ok(value) => match value.try_format(span, world, &registrations) {
Ok(value) => info!(name: COMMAND_RESULT_NAME, "> {value}"),
Ok(value) => info!(name: COMMAND_RESULT_NAME, "{value}"),
Err(err) => error!("{err:?}"),
},
Err(err) => {
Expand Down
11 changes: 0 additions & 11 deletions src/builtin_parser/runner/unique_rc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,6 @@ impl<T: ?Sized> StrongRef<T> {
mod tests {
use super::*;

#[test]
fn weak_ref_upgrade_once() {
let rc = UniqueRc::new(0);

let weak = rc.borrow();

assert!(weak.upgrade().is_some());
assert!(weak.upgrade().is_none());
assert!(weak.upgrade().is_none());
}

#[test]
#[should_panic]
fn strong_ref_panic() {
Expand Down
10 changes: 7 additions & 3 deletions src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ use crate::{
prelude::ConsoleConfig,
};

/// The prefix for commands
const COMMAND_MESSAGE_PREFIX: &str = "$ ";
const COMMAND_RESULT_PREFIX: &str = "> ";
/// Identifier for log messages that show a previous command.
pub const COMMAND_MESSAGE_NAME: &str = "console_command";
/// Identifier for log messages that show the result of a history
Expand Down Expand Up @@ -217,7 +219,7 @@ fn format_line(

*command_index += 1;

// TODO: Handle more than just he first element
// TODO: Handle more than just the first element
if let Some(hint) = hints.first() {
const PREFIX_LEN: usize = COMMAND_MESSAGE_PREFIX.len();

Expand All @@ -241,10 +243,12 @@ fn format_line(
);
return text;
}
text.append(message.as_str(), 0.0, config.theme.format_text());
return text;
} else { // COMMAND_RESULT_NAME
text.append(COMMAND_RESULT_PREFIX, 0.0, config.theme.format_dark())
}
text.append(message.as_str(), 0.0, config.theme.format_text());

return text;
}
text.append(level.as_str(), 0.0, config.theme.format_level(*level));
text.append(&format!(" {message}"), 0.0, config.theme.format_text());
Expand Down

0 comments on commit 5d12435

Please sign in to comment.