1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
extern crate self as anansi;

pub use anansi_macros::*;
pub use tokio;
pub use tokio::test;
pub use hyper;

pub mod server;
pub mod web;
pub mod db;
pub mod records;
pub mod humanize;
mod datetime;
pub mod router;
pub mod forms;
pub mod migrations;
pub mod admin_site;
pub mod cache;
pub mod project;
pub mod email;

pub mod test;

#[cfg(test)]
mod tests {
    #[test]
    fn migrate() {
        let current = std::env::current_dir().unwrap();
        let mut sql = String::from("anansi::operations! {\n");
        let mut v = vec![];
        let app = "auth";
        let s = format!("{}/../anansi/src/util/{}/records.rs", current.into_os_string().into_string().unwrap(), app);
        let content = std::fs::read_to_string(s).unwrap();
        anansi::migrations::process_syntax(app, content, &mut v);
        anansi::migrations::new_syntax(&mut sql, v);
        println!("{}}}", sql);
    }
}