Even even more range cleanup
This commit is contained in:
parent
f537a6125e
commit
5e7bfe514a
1
lib.rs
1
lib.rs
@ -62,6 +62,7 @@ fn main() {
|
||||
#[warn(missing_doc)];
|
||||
|
||||
#[feature(macro_rules, struct_variant, globs)];
|
||||
#[macro_escape];
|
||||
|
||||
extern mod extra;
|
||||
extern mod openssl = "github.com/sfackler/rust-openssl";
|
||||
|
32
test.rs
32
test.rs
@ -366,32 +366,20 @@ fn test_tm_params() {
|
||||
|
||||
macro_rules! test_range(
|
||||
($name:expr, $t:ty, $low:expr, $low_str:expr, $high:expr, $high_str:expr) => ({
|
||||
let tests = [(Some(Range::new(None, None)), ~"'(,)'"),
|
||||
(Some(Range::new(Some(RangeBound::new($low, Inclusive)),
|
||||
None)),
|
||||
"'[" + $low_str + ",)'"),
|
||||
(Some(Range::new(Some(RangeBound::new($low, Exclusive)),
|
||||
None)),
|
||||
"'(" + $low_str + ",)'"),
|
||||
(Some(Range::new(None,
|
||||
Some(RangeBound::new($high, Inclusive)))),
|
||||
"'(," + $high_str + "]'"),
|
||||
(Some(Range::new(None,
|
||||
Some(RangeBound::new($high, Exclusive)))),
|
||||
"'(," + $high_str + ")'"),
|
||||
(Some(Range::new(Some(RangeBound::new($low, Inclusive)),
|
||||
Some(RangeBound::new($high, Inclusive)))),
|
||||
let tests = [(Some(range!('(', ')')), ~"'(,)'"),
|
||||
(Some(range!('[' $low, ')')), "'[" + $low_str + ",)'"),
|
||||
(Some(range!('(' $low, ')')), "'(" + $low_str + ",)'"),
|
||||
(Some(range!('(', $high ']')), "'(," + $high_str + "]'"),
|
||||
(Some(range!('(', $high ')')), "'(," + $high_str + ")'"),
|
||||
(Some(range!('[' $low, $high ']')),
|
||||
"'[" + $low_str + "," + $high_str + "]'"),
|
||||
(Some(Range::new(Some(RangeBound::new($low, Inclusive)),
|
||||
Some(RangeBound::new($high, Exclusive)))),
|
||||
(Some(range!('[' $low, $high ')')),
|
||||
"'[" + $low_str + "," + $high_str + ")'"),
|
||||
(Some(Range::new(Some(RangeBound::new($low, Exclusive)),
|
||||
Some(RangeBound::new($high, Inclusive)))),
|
||||
(Some(range!('(' $low, $high ']')),
|
||||
"'(" + $low_str + "," + $high_str + "]'"),
|
||||
(Some(Range::new(Some(RangeBound::new($low, Exclusive)),
|
||||
Some(RangeBound::new($high, Exclusive)))),
|
||||
(Some(range!('(' $low, $high ')')),
|
||||
"'(" + $low_str + "," + $high_str + ")'"),
|
||||
(Some(Range::empty()), ~"'empty'"),
|
||||
(Some(range!(empty)), ~"'empty'"),
|
||||
(None, ~"NULL")];
|
||||
test_type($name, tests);
|
||||
})
|
||||
|
@ -1,4 +1,5 @@
|
||||
//! Traits dealing with Postgres data types
|
||||
#[macro_escape];
|
||||
|
||||
extern mod extra;
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
//! Types dealing with ranges of values
|
||||
#[macro_escape];
|
||||
|
||||
extern mod extra;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user