From 2906738cb823a2a05f933c9d3008ce16b1d36f53 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 27 Oct 2026 18:16:49 +0000 Subject: [PATCH 1/3] test(cli): add tests for tsc lint --fix and clarify deprecation comments Co-authored-by: Tcode-Motion <188012755+Tcode-Motion@users.noreply.github.com> --- cli/src/commands/lint.rs | 2 +- cli/tests/cli_tests.rs | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/cli/src/commands/lint.rs b/cli/src/commands/lint.rs index 773ba2da..ba9d8159 100644 --- a/cli/src/commands/lint.rs +++ b/cli/src/commands/lint.rs @@ -70,7 +70,7 @@ pub fn execute(path_str: Option<&str>, fix: bool) -> ExitCode { } } - // Fix deprecation warnings + // If --fix is enabled, automatically modernize deprecated keywords and constructs if fix { let migrated = migrate_source(&content); if migrated != content { diff --git a/cli/tests/cli_tests.rs b/cli/tests/cli_tests.rs index 7dc47930..f8de2999 100644 --- a/cli/tests/cli_tests.rs +++ b/cli/tests/cli_tests.rs @@ -43,3 +43,30 @@ fn test_cli_emit_commands() { _ => panic!("Expected EmitLlvm subcommand"), } } + +#[test] +fn test_cli_lint_fix() { + let args = vec!["tech", "lint", "src/main.txs", "--fix"]; + let cli = Cli::try_parse_from(args).expect("args parse successfully"); + match cli.command { + Commands::Lint { path, fix } => { + assert_eq!(path.as_deref(), Some("src/main.txs")); + assert!(fix); + } + _ => panic!("Expected Lint subcommand"), + } + + // Verify actual lint execute with --fix on a temporary file with deprecated syntax + let temp_dir = std::env::temp_dir().join("techscript_lint_test"); + let _ = std::fs::create_dir_all(&temp_dir); + let test_file = temp_dir.join("deprecated.txs"); + std::fs::write(&test_file, "let x = 10;").expect("write test file"); + + let status = techscript_cli::commands::lint::execute(Some(test_file.to_str().unwrap()), true); + assert_eq!(status, techscript_cli::exit_code::ExitCode::Success); + + let content = std::fs::read_to_string(&test_file).expect("read test file"); + assert_eq!(content, "x = 10"); + + let _ = std::fs::remove_dir_all(&temp_dir); +} From 11b4a90a2b72947c6588e4ab71e6c0519d820b3f Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 27 Oct 2026 23:19:29 +0000 Subject: [PATCH 2/3] test(cli): add tests for tsc lint --fix and fix threads example timing Co-authored-by: Tcode-Motion <188012755+Tcode-Motion@users.noreply.github.com> --- examples/threads/expected.txt | 2 +- examples/threads/threads.txs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/threads/expected.txt b/examples/threads/expected.txt index 1ec19b12..39f83cd9 100644 --- a/examples/threads/expected.txt +++ b/examples/threads/expected.txt @@ -1,4 +1,4 @@ Starting threads... -Task B completed on worker thread. Task A completed on worker thread. +Task B completed on worker thread. All threads joined main thread. diff --git a/examples/threads/threads.txs b/examples/threads/threads.txs index 7396bb40..557f8633 100644 --- a/examples/threads/threads.txs +++ b/examples/threads/threads.txs @@ -6,12 +6,12 @@ spawn_fn = thread["spawn"] join_fn = thread["join"] do task_a() - time.sleep(100) + time.sleep(50) say "Task A completed on worker thread." end do task_b() - time.sleep(50) + time.sleep(100) say "Task B completed on worker thread." end From 6c7438a3db1392c96c68c434c40e3fc674b85c9d Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 28 Oct 2026 01:09:41 +0000 Subject: [PATCH 3/3] test(cli): add tests for tsc lint --fix and clarify deprecation comments Co-authored-by: Tcode-Motion <188012755+Tcode-Motion@users.noreply.github.com> --- examples/threads/expected.txt | 2 +- examples/threads/threads.txs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/threads/expected.txt b/examples/threads/expected.txt index 39f83cd9..1ec19b12 100644 --- a/examples/threads/expected.txt +++ b/examples/threads/expected.txt @@ -1,4 +1,4 @@ Starting threads... -Task A completed on worker thread. Task B completed on worker thread. +Task A completed on worker thread. All threads joined main thread. diff --git a/examples/threads/threads.txs b/examples/threads/threads.txs index 557f8633..7396bb40 100644 --- a/examples/threads/threads.txs +++ b/examples/threads/threads.txs @@ -6,12 +6,12 @@ spawn_fn = thread["spawn"] join_fn = thread["join"] do task_a() - time.sleep(50) + time.sleep(100) say "Task A completed on worker thread." end do task_b() - time.sleep(100) + time.sleep(50) say "Task B completed on worker thread." end