forked from rojo-rbx/rojo
Move rojo-test snapshots into partitioned folders
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use std::{fs, process::Command};
|
||||
use std::{fs, path::Path, process::Command};
|
||||
|
||||
use insta::assert_snapshot;
|
||||
use tempfile::tempdir;
|
||||
@@ -12,6 +12,7 @@ macro_rules! gen_build_tests {
|
||||
#[test]
|
||||
fn [<build_ $test_name>]() {
|
||||
let _ = env_logger::try_init();
|
||||
|
||||
run_build_test(stringify!($test_name));
|
||||
}
|
||||
}
|
||||
@@ -78,5 +79,12 @@ fn run_build_test(test_name: &str) {
|
||||
|
||||
let contents = fs::read_to_string(&output_path).expect("Couldn't read output file");
|
||||
|
||||
assert_snapshot!(test_name, contents);
|
||||
let mut settings = insta::Settings::new();
|
||||
|
||||
let snapshot_path = Path::new(env!("CARGO_MANIFEST_DIR")).join("build-test-snapshots");
|
||||
settings.set_snapshot_path(snapshot_path);
|
||||
|
||||
settings.bind(|| {
|
||||
assert_snapshot!(test_name, contents);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use std::{
|
||||
fs,
|
||||
path::PathBuf,
|
||||
path::{Path, PathBuf},
|
||||
process::Command,
|
||||
sync::atomic::{AtomicUsize, Ordering},
|
||||
};
|
||||
@@ -18,11 +18,18 @@ use crate::util::{
|
||||
fn empty() {
|
||||
let _ = env_logger::try_init();
|
||||
|
||||
let mut session = TestServeSession::new("empty");
|
||||
let info = session.wait_to_come_online();
|
||||
let mut settings = insta::Settings::new();
|
||||
|
||||
assert_yaml_snapshot!(info, {
|
||||
".sessionId" => "[session id]"
|
||||
let snapshot_path = Path::new(env!("CARGO_MANIFEST_DIR")).join("serve-test-snapshots");
|
||||
settings.set_snapshot_path(snapshot_path);
|
||||
|
||||
settings.bind(|| {
|
||||
let mut session = TestServeSession::new("empty");
|
||||
let info = session.wait_to_come_online();
|
||||
|
||||
assert_yaml_snapshot!(info, {
|
||||
".sessionId" => "[session id]"
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
---
|
||||
created: "2019-08-09T01:29:47.650277200Z"
|
||||
creator: insta@0.10.0
|
||||
source: rojo-test/src/build_test.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
<Item class="Folder" referent="0">
|
||||
<Properties>
|
||||
<string name="Name">client_in_folder</string>
|
||||
</Properties>
|
||||
<Item class="LocalScript" referent="1">
|
||||
<Properties>
|
||||
<string name="Name">localScript</string>
|
||||
<string name="Source">-- This is a Lua client script</string>
|
||||
</Properties>
|
||||
</Item>
|
||||
</Item>
|
||||
</roblox>
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
created: "2019-08-16T19:37:51.277332900Z"
|
||||
creator: insta@0.10.0
|
||||
source: rojo-test/src/build_test.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
<Item class="LocalScript" referent="0">
|
||||
<Properties>
|
||||
<string name="Name">client_init</string>
|
||||
<string name="Source">return "From folder/init.client.lua"</string>
|
||||
</Properties>
|
||||
</Item>
|
||||
</roblox>
|
||||
@@ -1,19 +0,0 @@
|
||||
---
|
||||
created: "2019-08-14T22:42:52.297447700Z"
|
||||
creator: insta@0.10.0
|
||||
source: rojo-test/src/build_test.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
<Item class="Folder" referent="0">
|
||||
<Properties>
|
||||
<string name="Name">csv_bug_145</string>
|
||||
</Properties>
|
||||
<Item class="LocalizationTable" referent="1">
|
||||
<Properties>
|
||||
<string name="Name">normal</string>
|
||||
<string name="Contents">[{"key":"Count","example":"A number demonstrating issue 145","source":"3","values":{"es":"7"}}]</string>
|
||||
</Properties>
|
||||
</Item>
|
||||
</Item>
|
||||
</roblox>
|
||||
@@ -1,19 +0,0 @@
|
||||
---
|
||||
created: "2019-08-14T22:42:52.310414Z"
|
||||
creator: insta@0.10.0
|
||||
source: rojo-test/src/build_test.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
<Item class="Folder" referent="0">
|
||||
<Properties>
|
||||
<string name="Name">csv_bug_147</string>
|
||||
</Properties>
|
||||
<Item class="LocalizationTable" referent="1">
|
||||
<Properties>
|
||||
<string name="Name">normal</string>
|
||||
<string name="Contents">[{"key":"Language.Name","source":"English","values":{}},{"key":"Language.Region","source":"United States","values":{}},{"key":"Label.Thickness","source":"Thickness","values":{}},{"key":"Label.Opacity","source":"Opacity","values":{}},{"key":"Toolbar.Undo","source":"Undo","values":{}},{"key":"Toolbar.Redo","source":"Redo","values":{}},{"key":"Toolbar.Camera","source":"Top-down camera","values":{}},{"key":"Toolbar.Saves","source":"Saved drawings","values":{}},{"key":"Toolbar.Preferences","source":"Settings","values":{}},{"key":"Toolbar.Mode.Vector","source":"Vector mode","values":{}},{"key":"Toolbar.Mode.Pixel","source":"Pixel mode","values":{}}]</string>
|
||||
</Properties>
|
||||
</Item>
|
||||
</Item>
|
||||
</roblox>
|
||||
@@ -1,19 +0,0 @@
|
||||
---
|
||||
created: "2019-08-14T22:34:06.206495600Z"
|
||||
creator: insta@0.10.0
|
||||
source: rojo-test/src/build_test.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
<Item class="Folder" referent="0">
|
||||
<Properties>
|
||||
<string name="Name">csv_in_folder</string>
|
||||
</Properties>
|
||||
<Item class="LocalizationTable" referent="1">
|
||||
<Properties>
|
||||
<string name="Name">normal</string>
|
||||
<string name="Contents">[{"key":"Ack","example":"An exclamation of despair","source":"Ack!","values":{"es":"¡Ay!"}}]</string>
|
||||
</Properties>
|
||||
</Item>
|
||||
</Item>
|
||||
</roblox>
|
||||
@@ -1,28 +0,0 @@
|
||||
---
|
||||
created: "2019-08-29T23:38:13.072820400Z"
|
||||
creator: insta@0.10.1
|
||||
source: rojo-test/src/build_test.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
<Item class="Folder" referent="0">
|
||||
<Properties>
|
||||
<string name="Name">deep_nesting</string>
|
||||
</Properties>
|
||||
<Item class="Folder" referent="1">
|
||||
<Properties>
|
||||
<string name="Name">level-1</string>
|
||||
</Properties>
|
||||
<Item class="Folder" referent="2">
|
||||
<Properties>
|
||||
<string name="Name">level-2</string>
|
||||
</Properties>
|
||||
<Item class="Folder" referent="3">
|
||||
<Properties>
|
||||
<string name="Name">level-3</string>
|
||||
</Properties>
|
||||
</Item>
|
||||
</Item>
|
||||
</Item>
|
||||
</Item>
|
||||
</roblox>
|
||||
@@ -1,13 +0,0 @@
|
||||
---
|
||||
created: "2019-08-08T00:48:33.382271800Z"
|
||||
creator: insta@0.10.0
|
||||
source: rojo-test/src/build_test.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
<Item class="Folder" referent="0">
|
||||
<Properties>
|
||||
<string name="Name">gitkeep</string>
|
||||
</Properties>
|
||||
</Item>
|
||||
</roblox>
|
||||
@@ -1,20 +0,0 @@
|
||||
---
|
||||
created: "2019-08-30T00:12:56.686707700Z"
|
||||
creator: insta@0.10.1
|
||||
source: rojo-test/src/build_test.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
<Item class="ModuleScript" referent="0">
|
||||
<Properties>
|
||||
<string name="Name">init_with_children</string>
|
||||
<string name="Source">-- init.lua</string>
|
||||
</Properties>
|
||||
<Item class="ModuleScript" referent="1">
|
||||
<Properties>
|
||||
<string name="Name">other</string>
|
||||
<string name="Source">-- other.lua</string>
|
||||
</Properties>
|
||||
</Item>
|
||||
</Item>
|
||||
</roblox>
|
||||
@@ -1,24 +0,0 @@
|
||||
---
|
||||
created: "2019-08-15T20:40:50.467761900Z"
|
||||
creator: insta@0.10.0
|
||||
source: rojo-test/src/build_test.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
<Item class="Folder" referent="0">
|
||||
<Properties>
|
||||
<string name="Name">json_model_in_folder</string>
|
||||
</Properties>
|
||||
<Item class="IntValue" referent="1">
|
||||
<Properties>
|
||||
<string name="Name">simple-model</string>
|
||||
<int name="Value">5</int>
|
||||
</Properties>
|
||||
<Item class="Folder" referent="2">
|
||||
<Properties>
|
||||
<string name="Name">A Child</string>
|
||||
</Properties>
|
||||
</Item>
|
||||
</Item>
|
||||
</Item>
|
||||
</roblox>
|
||||
@@ -1,18 +0,0 @@
|
||||
---
|
||||
created: "2019-08-15T20:41:28.743618200Z"
|
||||
creator: insta@0.10.0
|
||||
source: rojo-test/src/build_test.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
<Item class="Folder" referent="0">
|
||||
<Properties>
|
||||
<string name="Name">json_model_legacy_name</string>
|
||||
</Properties>
|
||||
<Item class="Folder" referent="1">
|
||||
<Properties>
|
||||
<string name="Name">Expected Name</string>
|
||||
</Properties>
|
||||
</Item>
|
||||
</Item>
|
||||
</roblox>
|
||||
@@ -1,19 +0,0 @@
|
||||
---
|
||||
created: "2019-08-09T01:27:22.597759700Z"
|
||||
creator: insta@0.10.0
|
||||
source: rojo-test/src/build_test.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
<Item class="Folder" referent="0">
|
||||
<Properties>
|
||||
<string name="Name">module_in_folder</string>
|
||||
</Properties>
|
||||
<Item class="ModuleScript" referent="1">
|
||||
<Properties>
|
||||
<string name="Name">aModule</string>
|
||||
<string name="Source">-- This is a Lua module</string>
|
||||
</Properties>
|
||||
</Item>
|
||||
</Item>
|
||||
</roblox>
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
created: "2019-08-16T19:36:55.442461700Z"
|
||||
creator: insta@0.10.0
|
||||
source: rojo-test/src/build_test.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
<Item class="ModuleScript" referent="0">
|
||||
<Properties>
|
||||
<string name="Name">module_init</string>
|
||||
<string name="Source">return "From folder/init.lua"</string>
|
||||
</Properties>
|
||||
</Item>
|
||||
</roblox>
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
created: "2019-08-09T00:17:42.253380600Z"
|
||||
creator: insta@0.10.0
|
||||
source: rojo-test/src/build_test.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
<Item class="StringValue" referent="0">
|
||||
<Properties>
|
||||
<string name="Name">plain</string>
|
||||
<string name="Value">This is a bare text file with no project.</string>
|
||||
</Properties>
|
||||
</Item>
|
||||
</roblox>
|
||||
@@ -1,13 +0,0 @@
|
||||
---
|
||||
created: "2019-08-09T00:17:42.175575800Z"
|
||||
creator: insta@0.10.0
|
||||
source: rojo-test/src/build_test.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
<Item class="Folder" referent="0">
|
||||
<Properties>
|
||||
<string name="Name">plain_gitkeep</string>
|
||||
</Properties>
|
||||
</Item>
|
||||
</roblox>
|
||||
@@ -1,18 +0,0 @@
|
||||
---
|
||||
created: "2019-08-14T22:05:46.597722600Z"
|
||||
creator: insta@0.10.0
|
||||
source: rojo-test/src/build_test.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
<Item class="Folder" referent="0">
|
||||
<Properties>
|
||||
<string name="Name">rbxm_in_folder</string>
|
||||
</Properties>
|
||||
<Item class="Folder" referent="1">
|
||||
<Properties>
|
||||
<string name="Name">foo</string>
|
||||
</Properties>
|
||||
</Item>
|
||||
</Item>
|
||||
</roblox>
|
||||
@@ -1,41 +0,0 @@
|
||||
---
|
||||
created: "2019-08-10T07:45:07.961823500Z"
|
||||
creator: insta@0.10.0
|
||||
source: rojo-test/src/build_test.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
<Item class="Folder" referent="0">
|
||||
<Properties>
|
||||
<string name="Name">rbxmx_in_folder</string>
|
||||
</Properties>
|
||||
<Item class="Model" referent="1">
|
||||
<Properties>
|
||||
<string name="Name">test-model</string>
|
||||
<CoordinateFrame name="ModelInPrimary">
|
||||
<X>0</X>
|
||||
<Y>0</Y>
|
||||
<Z>0</Z>
|
||||
<R00>1</R00>
|
||||
<R01>0</R01>
|
||||
<R02>0</R02>
|
||||
<R10>0</R10>
|
||||
<R11>1</R11>
|
||||
<R12>0</R12>
|
||||
<R20>0</R20>
|
||||
<R21>0</R21>
|
||||
<R22>1</R22>
|
||||
</CoordinateFrame>
|
||||
<Ref name="PrimaryPart">null</Ref>
|
||||
<BinaryString name="Tags"><![CDATA[]]></BinaryString>
|
||||
</Properties>
|
||||
<Item class="StringValue" referent="2">
|
||||
<Properties>
|
||||
<string name="Name">Cool StringValue</string>
|
||||
<BinaryString name="Tags"><![CDATA[]]></BinaryString>
|
||||
<string name="Value">Did you know that BaseValue.Changed is different than Instance.Changed?</string>
|
||||
</Properties>
|
||||
</Item>
|
||||
</Item>
|
||||
</Item>
|
||||
</roblox>
|
||||
@@ -1,28 +0,0 @@
|
||||
---
|
||||
created: "2019-08-10T07:57:42.835269100Z"
|
||||
creator: insta@0.10.0
|
||||
source: rojo-test/src/build_test.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
<Item class="Folder" referent="0">
|
||||
<Properties>
|
||||
<string name="Name">rbxmx_ref</string>
|
||||
<BinaryString name="Tags"><![CDATA[]]></BinaryString>
|
||||
</Properties>
|
||||
<Item class="StringValue" referent="1">
|
||||
<Properties>
|
||||
<string name="Name">Target</string>
|
||||
<BinaryString name="Tags"><![CDATA[]]></BinaryString>
|
||||
<string name="Value">Pointed to by ObjectValue</string>
|
||||
</Properties>
|
||||
</Item>
|
||||
<Item class="ObjectValue" referent="2">
|
||||
<Properties>
|
||||
<string name="Name">Pointer</string>
|
||||
<BinaryString name="Tags"><![CDATA[]]></BinaryString>
|
||||
<Ref name="Value">1</Ref>
|
||||
</Properties>
|
||||
</Item>
|
||||
</Item>
|
||||
</roblox>
|
||||
@@ -1,19 +0,0 @@
|
||||
---
|
||||
created: "2019-08-09T01:29:48.071133300Z"
|
||||
creator: insta@0.10.0
|
||||
source: rojo-test/src/build_test.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
<Item class="Folder" referent="0">
|
||||
<Properties>
|
||||
<string name="Name">server_in_folder</string>
|
||||
</Properties>
|
||||
<Item class="Script" referent="1">
|
||||
<Properties>
|
||||
<string name="Name">serverScript</string>
|
||||
<string name="Source">-- This is a Lua server script</string>
|
||||
</Properties>
|
||||
</Item>
|
||||
</Item>
|
||||
</roblox>
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
created: "2019-08-16T19:36:55.442461700Z"
|
||||
creator: insta@0.10.0
|
||||
source: rojo-test/src/build_test.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
<Item class="Script" referent="0">
|
||||
<Properties>
|
||||
<string name="Name">server_init</string>
|
||||
<string name="Source">return "From folder/init.server.lua"</string>
|
||||
</Properties>
|
||||
</Item>
|
||||
</roblox>
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
created: "2019-08-09T00:22:01.983322Z"
|
||||
creator: insta@0.10.0
|
||||
source: rojo-test/src/build_test.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
<Item class="StringValue" referent="0">
|
||||
<Properties>
|
||||
<string name="Name">txt</string>
|
||||
<string name="Value">This is a txt file in a project.</string>
|
||||
</Properties>
|
||||
</Item>
|
||||
</roblox>
|
||||
@@ -1,19 +0,0 @@
|
||||
---
|
||||
created: "2019-08-08T00:48:33.502257600Z"
|
||||
creator: insta@0.10.0
|
||||
source: rojo-test/src/build_test.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
<Item class="Folder" referent="0">
|
||||
<Properties>
|
||||
<string name="Name">txt_in_folder</string>
|
||||
</Properties>
|
||||
<Item class="StringValue" referent="1">
|
||||
<Properties>
|
||||
<string name="Name">foo</string>
|
||||
<string name="Value"></string>
|
||||
</Properties>
|
||||
</Item>
|
||||
</Item>
|
||||
</roblox>
|
||||
@@ -1,8 +0,0 @@
|
||||
---
|
||||
source: rojo-test/src/serve_test.rs
|
||||
expression: info
|
||||
---
|
||||
sessionId: "[session id]"
|
||||
serverVersion: 0.5.0
|
||||
protocolVersion: 3
|
||||
expectedPlaceIds: ~
|
||||
Reference in New Issue
Block a user