#[cfg(test)] mod tests { use json::array; use df_helper::orm::fields::field; use df_helper::orm::fields::field::Field; #[test] fn field() { let data = field::Key::field("key", "ID", 10, true).sql(); println!("{}", data); let data = field::Key::field("key", "ID", 10, false).sql(); println!("{}", data); let data = field::Str::string(true, "name", "ID", 10, "123132123").sql(); println!("{}", data); let data = field::Str::pass(true, "pass", "名称", 10, "123123").sql(); println!("{}", data); let data = field::Number::field(true, "number", "数字", 10, 2, 0.1).sql(); println!("{}", data); let data = field::Table::field(true, "table", "关联", "admin_admin", "id,name", "", "admin.admin.admin").sql(); println!("{}", data); let data = field::File::field(true, "file", "附件", 2, "").sql(); println!("{}", data); let data = field::Switch::field(true, "switch", "开关", true).sql(); println!("{}", data); let data = field::Date::datetime(true, "datetime", "日期时间", "0000-00-00 00:00:00").sql(); println!("{}", data); let data = field::Date::date(true, "date", "日期", "0000-00-00 ").sql(); println!("{}", data); let data = field::Date::time(true, "time", "时间", "00:00:00").sql(); println!("{}", data); let data = field::Timestamp::timestamp(true, "timestamp", "时间", 4, "0000-00-00 00:00:00").sql(); println!("{}", data); let data = field::Select::field(true, "select", "选项", array![123,33,444].into(), false, 12.into()).sql(); println!("{}", data); let data = field::Select::field(true, "select", "选项", array![2231,111,222].into(), true, "123,231".into()).sql(); println!("{}", data); let data = field::Select::field(true, "select", "选项", array![2231,111,222].into(), true, "123,231".into()).sql(); println!("{}", data); let data = field::Text::field(true, "select", "选项","我的测试").sql(); println!("{}", data); } }