Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ edition = "2021"
serde = { version = "1.0", features = ["derive"]}
serde_json = "1.0"
anyhow = "1.0"
lazy_static = "1.4"
smallvec = "1.11"
env_logger = "0.10"
log = "0.4.20"
Expand Down
2 changes: 1 addition & 1 deletion src/bytecode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ impl Op {
&Self::StackRef(v) if (1..=4).contains(&v) =>
Ok(smallvec![v as u8]),
&Self::StackRef(_) => unimplemented!(),
&Self::List(v) if v == 0 => unreachable!(),
&Self::List(0) => unreachable!(),
&Self::List(v) if (1..=4).contains(&v) => Ok(smallvec![66 + v]),
&Self::List(v) => Ok(smallvec![175, v]),
&Self::Discard => Ok(smallvec![136]),
Expand Down
4 changes: 1 addition & 3 deletions tests/app_test.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
use anyhow::Result;
use tempfile;
use env_logger;

use emacs_lsp_booster::{app, rpcio};

Expand All @@ -23,7 +21,7 @@ fn test_app_with_echo_server() -> Result<()> {
});

let mut cmd = std::process::Command::new("timeout");
cmd.args(&["1", "cat"]);
cmd.args(["1", "cat"]);

let exit_status = app::run_app_forever(input_pair_out, output_file, cmd, app::AppOptions {
bytecode_options: Some(Default::default()),
Expand Down
9 changes: 4 additions & 5 deletions tests/bytecode_test.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use serde_json as json;
use anyhow::Result;
use tempfile;

use emacs_lsp_booster::bytecode;

Expand All @@ -9,7 +8,7 @@ fn run_one_test(json_str: &str, object_type: bytecode::ObjectType) -> Result<()>
let json_value: json::Value = json::from_str(json_str)?;
let json_str_nowhitespaces = json_value.to_string();
let bytecode = bytecode::generate_bytecode_repl(&json_value, bytecode::BytecodeOptions {
object_type: object_type.clone(),
object_type,
..Default::default()
})?;

Expand Down Expand Up @@ -52,9 +51,9 @@ fn test_bytecode() {
// unicode test
run_one_test(r#"{"a":"ÀÁÂÃÄÅÆÇÈÉÊËÌ abcd \n 你好世界"}"#, bytecode::ObjectType::Plist).unwrap();

for object_type in vec![bytecode::ObjectType::Plist,
bytecode::ObjectType::Alist,
bytecode::ObjectType::Hashtable] {
for object_type in [bytecode::ObjectType::Plist,
bytecode::ObjectType::Alist,
bytecode::ObjectType::Hashtable] {
eprintln!("Testing completion.json (~100KB), object type = {:?}", object_type);
run_one_test(include_str!("./data/completion.json"), object_type).unwrap();

Expand Down