mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-23 06:05:24 +00:00
WIP: Epiphany Refactor (#85)
This commit is contained in:
committed by
GitHub
parent
80b9b7594b
commit
72bc77f1d5
36
server/tests/read_projects.rs
Normal file
36
server/tests/read_projects.rs
Normal file
@@ -0,0 +1,36 @@
|
||||
#[macro_use] extern crate lazy_static;
|
||||
|
||||
extern crate librojo;
|
||||
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
path::{Path, PathBuf},
|
||||
};
|
||||
|
||||
use librojo::{
|
||||
project::Project,
|
||||
};
|
||||
|
||||
lazy_static! {
|
||||
static ref TEST_PROJECTS_ROOT: PathBuf = {
|
||||
Path::new(env!("CARGO_MANIFEST_DIR")).join("../test-projects")
|
||||
};
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn foo() {
|
||||
let project_file_location = TEST_PROJECTS_ROOT.join("foo.json");
|
||||
let project = Project::load_exact(&project_file_location).unwrap();
|
||||
|
||||
assert_eq!(project.name, "foo");
|
||||
assert_eq!(project.tree.len(), 1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn empty() {
|
||||
let project_file_location = TEST_PROJECTS_ROOT.join("empty/roblox-project.json");
|
||||
let project = Project::load_exact(&project_file_location).unwrap();
|
||||
|
||||
assert_eq!(project.name, "empty");
|
||||
assert_eq!(project.tree.len(), 0);
|
||||
}
|
||||
Reference in New Issue
Block a user