Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Commit

Permalink
Adapt parse error test
Browse files Browse the repository at this point in the history
  • Loading branch information
Xanewok committed Jul 8, 2017
1 parent 5bccad7 commit c8b6efe
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ mod harness;

use std::sync::Arc;
use env_logger;
use serde_json;

use analysis;
use server::{self as ls_server, ServerMessage, Request, Method};
use jsonrpc_core;
use vfs;

use self::harness::{expect_messages, ExpectedMessage, init_env, mock_server, RecordOutput, src};
Expand Down Expand Up @@ -452,5 +454,10 @@ fn test_parse_error_on_malformed_input() {

let error = results.lock().unwrap()
.pop().expect("no error response");
assert!(error.contains(r#""code": -32700"#))

let failure: jsonrpc_core::Failure = serde_json::from_str(&error)
.expect("Couldn't parse json failure response");

const PARSE_ERROR: jsonrpc_core::ErrorCode = jsonrpc_core::ErrorCode::ParseError;
assert!(failure.error.code == PARSE_ERROR);
}

0 comments on commit c8b6efe

Please sign in to comment.