From cbe4467a2259b3ec05f3e18a493b9a354868859e Mon Sep 17 00:00:00 2001 From: Lucien Greathouse Date: Thu, 1 Aug 2019 17:53:29 -0700 Subject: [PATCH] Upgrade dependencies and add SpawnLocation test case --- Cargo.lock | 14 +- server/tests/tree_snapshots.rs | 9 + .../spawn_location/default.project.json | 6 + .../spawn_location/initial.tree.json | 266 ++++++++++++++++++ test-projects/spawn_location/src/spawn.rbxmx | 85 ++++++ 5 files changed, 373 insertions(+), 7 deletions(-) create mode 100644 test-projects/spawn_location/default.project.json create mode 100644 test-projects/spawn_location/initial.tree.json create mode 100644 test-projects/spawn_location/src/spawn.rbxmx diff --git a/Cargo.lock b/Cargo.lock index 1b211f5a..7d6d8919 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1196,7 +1196,7 @@ dependencies = [ [[package]] name = "rbx_reflection" -version = "3.2.390" +version = "3.2.395" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1207,13 +1207,13 @@ dependencies = [ [[package]] name = "rbx_xml" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "rbx_dom_weak 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rbx_reflection 3.2.390 (registry+https://github.com/rust-lang/crates.io-index)", + "rbx_reflection 3.2.395 (registry+https://github.com/rust-lang/crates.io-index)", "xml-rs 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1350,8 +1350,8 @@ dependencies = [ "pretty_assertions 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "rbx_binary 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "rbx_dom_weak 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rbx_reflection 3.2.390 (registry+https://github.com/rust-lang/crates.io-index)", - "rbx_xml 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rbx_reflection 3.2.395 (registry+https://github.com/rust-lang/crates.io-index)", + "rbx_xml 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "reqwest 0.9.19 (registry+https://github.com/rust-lang/crates.io-index)", "ritz 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2069,8 +2069,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" "checksum rbx_binary 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "81428c521a07a3feac9c31180a886e467eecf81b769987f70d51d567a09c321d" "checksum rbx_dom_weak 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb8079fe850096bd18582a8661f5d7a6afee61bc914691be2f287050f3ac0ec4" -"checksum rbx_reflection 3.2.390 (registry+https://github.com/rust-lang/crates.io-index)" = "4f00e0d9e70f1825341e45ff610264778fc2fe72a733027feeca85bfcd6a7305" -"checksum rbx_xml 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1e6728d8701e2d78f7b15e793f2b5b4926cb4f0281d6f19371f506816ac89424" +"checksum rbx_reflection 3.2.395 (registry+https://github.com/rust-lang/crates.io-index)" = "e3b43ccce9c29e9f1774359cb96b6ea0c1b897d416dc00f5b45cf54866ca7997" +"checksum rbx_xml 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1b837fbcbbd4e0c82c0ba96d6b688a1a3b504a5b95aa4f09e2ede5b9deeb8186" "checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" "checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" "checksum regex 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6b23da8dfd98a84bd7e08700190a5d9f7d2d38abd4369dd1dae651bc40bfd2cc" diff --git a/server/tests/tree_snapshots.rs b/server/tests/tree_snapshots.rs index f5b991fa..d8f2d849 100644 --- a/server/tests/tree_snapshots.rs +++ b/server/tests/tree_snapshots.rs @@ -43,6 +43,15 @@ fn multi_partition_game() { tree_step("with_moved_dir", &live_session, &source_path); } +#[test] +fn spawn_location() { + let _ = env_logger::try_init(); + let source_path = project_path("spawn_location"); + + let (_dir, live_session) = start_session(&source_path); + tree_step("initial", &live_session, &source_path); +} + /// Find the path to the given test project relative to the manifest. fn project_path(name: &str) -> PathBuf { let mut path = Path::new(env!("CARGO_MANIFEST_DIR")).join("../test-projects"); diff --git a/test-projects/spawn_location/default.project.json b/test-projects/spawn_location/default.project.json new file mode 100644 index 00000000..b078dfaf --- /dev/null +++ b/test-projects/spawn_location/default.project.json @@ -0,0 +1,6 @@ +{ + "name": "spawn_location", + "tree": { + "$path": "src" + } +} \ No newline at end of file diff --git a/test-projects/spawn_location/initial.tree.json b/test-projects/spawn_location/initial.tree.json new file mode 100644 index 00000000..af079189 --- /dev/null +++ b/test-projects/spawn_location/initial.tree.json @@ -0,0 +1,266 @@ +{ + "instances": { + "21406306-61c7-45f6-9e3e-50cd6b609214": { + "Name": "spawn_location", + "ClassName": "Folder", + "Properties": {}, + "Id": "21406306-61c7-45f6-9e3e-50cd6b609214", + "Children": [ + "da5dd362-4eb6-488a-984b-c96327927a70" + ], + "Parent": null + }, + "da5dd362-4eb6-488a-984b-c96327927a70": { + "Name": "spawn", + "ClassName": "SpawnLocation", + "Properties": { + "Size": { + "Type": "Vector3", + "Value": [ + 12.0, + 1.0, + 12.0 + ] + }, + "Massless": { + "Type": "Bool", + "Value": false + }, + "LeftSurface": { + "Type": "Enum", + "Value": 0 + }, + "Color": { + "Type": "Color3", + "Value": [ + 0.6392157, + 0.63529414, + 0.64705884 + ] + }, + "RightSurfaceInput": { + "Type": "Enum", + "Value": 0 + }, + "Neutral": { + "Type": "Bool", + "Value": true + }, + "Locked": { + "Type": "Bool", + "Value": false + }, + "Anchored": { + "Type": "Bool", + "Value": true + }, + "CanCollide": { + "Type": "Bool", + "Value": true + }, + "FrontSurfaceInput": { + "Type": "Enum", + "Value": 0 + }, + "LeftSurfaceInput": { + "Type": "Enum", + "Value": 0 + }, + "RightSurface": { + "Type": "Enum", + "Value": 0 + }, + "FrontSurface": { + "Type": "Enum", + "Value": 0 + }, + "TopSurfaceInput": { + "Type": "Enum", + "Value": 0 + }, + "CastShadow": { + "Type": "Bool", + "Value": true + }, + "BottomSurface": { + "Type": "Enum", + "Value": 0 + }, + "Duration": { + "Type": "Int32", + "Value": 10 + }, + "Velocity": { + "Type": "Vector3", + "Value": [ + 0.0, + 0.0, + 0.0 + ] + }, + "BottomSurfaceInput": { + "Type": "Enum", + "Value": 0 + }, + "TopSurface": { + "Type": "Enum", + "Value": 0 + }, + "CFrame": { + "Type": "CFrame", + "Value": [ + -6.0, + 0.500001, + -11.0, + 1.0, + 0.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0, + 0.0, + 1.0 + ] + }, + "TeamColor": { + "Type": "BrickColor", + "Value": 194 + }, + "RotVelocity": { + "Type": "Vector3", + "Value": [ + 0.0, + 0.0, + 0.0 + ] + }, + "Reflectance": { + "Type": "Float32", + "Value": 0.0 + }, + "AllowTeamChangeOnTouch": { + "Type": "Bool", + "Value": false + }, + "RightParamA": { + "Type": "Float32", + "Value": -0.5 + }, + "LeftParamA": { + "Type": "Float32", + "Value": -0.5 + }, + "Tags": { + "Type": "BinaryString", + "Value": "" + }, + "Transparency": { + "Type": "Float32", + "Value": 0.0 + }, + "Shape": { + "Type": "Enum", + "Value": 1 + }, + "FrontParamA": { + "Type": "Float32", + "Value": -0.5 + }, + "RootPriority": { + "Type": "Int32", + "Value": 0 + }, + "FrontParamB": { + "Type": "Float32", + "Value": 0.5 + }, + "FormFactor": { + "Type": "Enum", + "Value": 1 + }, + "BottomParamB": { + "Type": "Float32", + "Value": 0.5 + }, + "BackSurface": { + "Type": "Enum", + "Value": 0 + }, + "BottomParamA": { + "Type": "Float32", + "Value": -0.5 + }, + "Enabled": { + "Type": "Bool", + "Value": true + }, + "BackParamB": { + "Type": "Float32", + "Value": 0.5 + }, + "BackParamA": { + "Type": "Float32", + "Value": -0.5 + }, + "LeftParamB": { + "Type": "Float32", + "Value": 0.5 + }, + "TopParamA": { + "Type": "Float32", + "Value": -0.5 + }, + "RightParamB": { + "Type": "Float32", + "Value": 0.5 + }, + "CollisionGroupId": { + "Type": "Int32", + "Value": 0 + }, + "BackSurfaceInput": { + "Type": "Enum", + "Value": 0 + }, + "CustomPhysicalProperties": { + "Type": "PhysicalProperties", + "Value": null + }, + "TopParamB": { + "Type": "Float32", + "Value": 0.5 + }, + "Material": { + "Type": "Enum", + "Value": 256 + } + }, + "Id": "da5dd362-4eb6-488a-984b-c96327927a70", + "Children": [], + "Parent": "21406306-61c7-45f6-9e3e-50cd6b609214" + } + }, + "root_id": "21406306-61c7-45f6-9e3e-50cd6b609214", + "metadata": { + "da5dd362-4eb6-488a-984b-c96327927a70": { + "ignore_unknown_instances": false, + "source_path": "src/spawn.rbxmx", + "project_definition": null + }, + "21406306-61c7-45f6-9e3e-50cd6b609214": { + "ignore_unknown_instances": false, + "source_path": "src", + "project_definition": [ + "spawn_location", + { + "class_name": null, + "children": {}, + "properties": {}, + "ignore_unknown_instances": null, + "path": "src" + } + ] + } + } +} \ No newline at end of file diff --git a/test-projects/spawn_location/src/spawn.rbxmx b/test-projects/spawn_location/src/spawn.rbxmx new file mode 100644 index 00000000..98a5cbe5 --- /dev/null +++ b/test-projects/spawn_location/src/spawn.rbxmx @@ -0,0 +1,85 @@ + + true + null + nil + + + false + true + -0.5 + 0.5 + 0 + 0 + -0.5 + 0.5 + 0 + 0 + + -6 + 0.500001013 + -11 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 1 + + true + true + 0 + 4288914085 + + false + + 10 + true + -0.5 + 0.5 + 0 + 0 + -0.5 + 0.5 + 0 + 0 + false + false + 256 + SpawnLocation + true + 0 + -0.5 + 0.5 + 0 + 0 + 0 + + 0 + 0 + 0 + + + 194 + -0.5 + 0.5 + 0 + 0 + 0 + + 0 + 0 + 0 + + 1 + 1 + + 12 + 1 + 12 + + + + \ No newline at end of file