@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.
- package/crates/tish/Cargo.toml +1 -1
- package/crates/tish/src/main.rs +1 -0
- package/crates/tish/tests/integration_test.rs +20 -0
- package/package.json +1 -1
- package/platform/darwin-arm64/tish +0 -0
- package/platform/darwin-x64/tish +0 -0
- package/platform/linux-arm64/tish +0 -0
- package/platform/linux-x64/tish +0 -0
- package/platform/win32-x64/tish.exe +0 -0
package/crates/tish/Cargo.toml
CHANGED
package/crates/tish/src/main.rs
CHANGED
|
@@ -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
|
Binary file
|
package/platform/darwin-x64/tish
CHANGED
|
Binary file
|
|
Binary file
|
package/platform/linux-x64/tish
CHANGED
|
Binary file
|
|
Binary file
|