-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't return None from Source::location when byte is at end of file
Since spans are exclusive they may refer to indexes one past the end.
- Loading branch information
1 parent
72eb1a0
commit 5aee09a
Showing
2 changed files
with
44 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
extern crate env_logger; | ||
extern crate gluon; | ||
|
||
mod support; | ||
|
||
use gluon::Compiler; | ||
|
||
#[test] | ||
fn dont_panic_when_error_span_is_at_eof() { | ||
let _ = ::env_logger::init(); | ||
let vm = support::make_vm(); | ||
let text = r#"abc"#; | ||
let result = Compiler::new().load_script(&vm, "test", text); | ||
assert!(result.is_err()); | ||
} |