🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

practicode

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

practicode - npm Package Compare versions

Comparing version
0.1.13
to
0.1.14
+1
-1
Cargo.lock

@@ -456,3 +456,3 @@ # This file is automatically @generated by Cargo.

name = "practicode"
version = "0.1.13"
version = "0.1.14"
dependencies = [

@@ -459,0 +459,0 @@ "anyhow",

[package]
name = "practicode"
version = "0.1.13"
version = "0.1.14"
edition = "2024"

@@ -5,0 +5,0 @@ description = "Local-first coding-test practice in a Rust terminal UI with optional AI help."

{
"name": "practicode",
"version": "0.1.13",
"version": "0.1.14",
"description": "Local-first coding-test practice in a Rust terminal UI with optional AI help.",

@@ -5,0 +5,0 @@ "license": "MIT",

use super::*;
const UPDATE_CHECKING_TEXT: &str = "Checking for updates...";
impl PracticodeApp {

@@ -85,2 +87,3 @@ pub(super) fn start_ai_prompt(&mut self, prompt: &str) -> Result<()> {

let result = self.update_rx.as_ref().and_then(|rx| rx.try_recv().ok());
let showing_update_check = self.output == UPDATE_CHECKING_TEXT;
if let Some(result) = result {

@@ -94,2 +97,5 @@ self.update_rx = None;

}
if showing_update_check {
self.show_update_notice();
}
}

@@ -292,3 +298,3 @@ }

} else if self.update_rx.is_some() {
self.write_text_output("Checking for updates...");
self.write_text_output(UPDATE_CHECKING_TEXT);
} else if matches!(self.update_check, Some(UpdateCheck::Disabled)) {

@@ -319,1 +325,21 @@ self.write_text_output(ui_text(&lang, "update_check_disabled"));

}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn update_check_refreshes_visible_checking_notice() {
let root = crate::process::unique_temp_path("practicode-update-test", "dir");
std::fs::create_dir_all(&root).unwrap();
let mut app = PracticodeApp::new(root).unwrap();
let (tx, rx) = std::sync::mpsc::channel();
tx.send(UpdateCheck::Disabled).unwrap();
app.update_rx = Some(rx);
app.write_text_output(UPDATE_CHECKING_TEXT);
app.check_update();
assert_eq!(app.output, ui_text("en", "update_check_disabled"));
}
}