Add test for #267.

This commit is contained in:
Lucien Greathouse
2019-11-18 18:11:33 -08:00
parent 2d7ebac8e6
commit 78b2bafde1
2 changed files with 34 additions and 1 deletions

View File

@@ -0,0 +1 @@
-- Original contents

View File

@@ -102,7 +102,6 @@ fn add_folder() {
}
#[test]
// #[ignore] // TODO: Removing files currently hangs ChangeProcessor
fn remove_file() {
run_serve_test("remove_file", |session, mut redactions| {
let info = session.get_api_rojo().unwrap();
@@ -132,6 +131,39 @@ fn remove_file() {
});
}
#[test]
// Editing an init file currently crashes the ChangeProcessor thread.
// https://github.com/rojo-rbx/rojo/issues/267
#[ignore]
fn edit_init() {
run_serve_test("edit_init", |session, mut redactions| {
let info = session.get_api_rojo().unwrap();
let root_id = info.root_instance_id;
assert_yaml_snapshot!("edit_init_info", redactions.redacted_yaml(info));
let read_response = session.get_api_read(root_id).unwrap();
assert_yaml_snapshot!(
"edit_init_all",
read_response.intern_and_redact(&mut redactions, root_id)
);
fs::write(session.path().join("init.lua"), b"-- Edited contents.").unwrap();
let subscribe_response = session.get_api_subscribe(0).unwrap();
assert_yaml_snapshot!(
"edit_init_subscribe",
subscribe_response.intern_and_redact(&mut redactions, ())
);
let read_response = session.get_api_read(root_id).unwrap();
assert_yaml_snapshot!(
"edit_init_all-2",
read_response.intern_and_redact(&mut redactions, root_id)
);
});
}
#[test]
fn move_folder_of_stuff() {
run_serve_test("move_folder_of_stuff", |session, mut redactions| {