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 11, 2017
1 parent 7839801 commit 6fa25e6
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,10 +15,12 @@ mod harness;

use std::sync::{Arc, Mutex};
use env_logger;
use serde_json;

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

use self::harness::{expect_messages, ExpectedMessage, init_env, mock_server, mock_server_with_config, RecordOutput, src};
Expand Down Expand Up @@ -459,5 +461,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 6fa25e6

Please sign in to comment.