@tishlang/tish 1.0.12 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "tish"
3
- version = "0.1.0"
3
+ version = "1.0.13"
4
4
  edition = "2021"
5
5
  description = "Tish CLI - run, REPL, compile to native"
6
6
  license-file = { workspace = true }
@@ -14,6 +14,7 @@ use rustyline::{Behavior, ColorMode, CompletionType, Config, Editor};
14
14
  #[derive(Parser)]
15
15
  #[command(name = "tish")]
16
16
  #[command(about = "Tish - minimal TS/JS-compatible language")]
17
+ #[command(version = env!("CARGO_PKG_VERSION"))]
17
18
  #[command(after_help = "To disable optimizations: TISH_NO_OPTIMIZE=1")]
18
19
  pub(crate) struct Cli {
19
20
  #[command(subcommand)]
@@ -163,6 +163,26 @@ fn tish_bin() -> PathBuf {
163
163
  default
164
164
  }
165
165
 
166
+ /// tish -V and --version print the version.
167
+ #[test]
168
+ fn test_tish_version_flag() {
169
+ let bin = tish_bin();
170
+ assert!(bin.exists(), "tish binary not found. Run `cargo build -p tish` first.");
171
+ let out = Command::new(&bin).arg("-V").output().expect("run tish -V");
172
+ assert!(out.status.success(), "tish -V failed: {}", String::from_utf8_lossy(&out.stderr));
173
+ let stdout = String::from_utf8_lossy(&out.stdout);
174
+ assert!(
175
+ stdout.contains(env!("CARGO_PKG_VERSION")),
176
+ "tish -V should print version {}; got: {}",
177
+ env!("CARGO_PKG_VERSION"),
178
+ stdout
179
+ );
180
+ let out2 = Command::new(&bin).arg("--version").output().expect("run tish --version");
181
+ assert!(out2.status.success());
182
+ let stdout2 = String::from_utf8_lossy(&out2.stdout);
183
+ assert!(stdout2.contains(env!("CARGO_PKG_VERSION")), "tish --version should print version");
184
+ }
185
+
166
186
  /// Parse async-await example (validates async fn parsing).
167
187
  #[test]
168
188
  fn test_async_await_parse() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tishlang/tish",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "Tish - minimal TS/JS-compatible language. Run, REPL, compile to native.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "repository": {
Binary file
Binary file
Binary file
Binary file
Binary file