Lines Matching refs:limit

33         if let Some(limit) = self.max_length {  in push()
34 if self.length() + utils::strwidth(&c.to_string()) <= limit { in push()
45 if let Some(limit) = self.max_length { in push_str()
46 let remaining_length = limit - self.length(); in push_str()
71 let limit = 15usize; in t_length_never_exceeds_the_limit() localVariable
72 let mut s = LimitedString::new(Some(limit)); in t_length_never_exceeds_the_limit()
75 assert!(s.length() < limit); in t_length_never_exceeds_the_limit()
78 assert!(s.length() < limit); in t_length_never_exceeds_the_limit()
81 assert_eq!(s.length(), limit); in t_length_never_exceeds_the_limit()
98 let limit = 12usize; in t_into_string_returns_a_string_of_the_same_length_limited_case() localVariable
99 let mut s = LimitedString::new(Some(limit)); in t_into_string_returns_a_string_of_the_same_length_limited_case()
102 assert_eq!(s.length(), limit); in t_into_string_returns_a_string_of_the_same_length_limited_case()
105 assert_eq!(utils::strwidth(&exported_string), limit); in t_into_string_returns_a_string_of_the_same_length_limited_case()
110 let limit = 3usize; in t_push_cannot_make_the_string_exceed_the_limit() localVariable
111 let mut s = LimitedString::new(Some(limit)); in t_push_cannot_make_the_string_exceed_the_limit()
115 assert!(s.length() < limit); in t_push_cannot_make_the_string_exceed_the_limit()
117 assert!(s.length() < limit); in t_push_cannot_make_the_string_exceed_the_limit()
119 assert_eq!(s.length(), limit); in t_push_cannot_make_the_string_exceed_the_limit()
121 assert_eq!(s.length(), limit); in t_push_cannot_make_the_string_exceed_the_limit()
123 assert_eq!(s.length(), limit); in t_push_cannot_make_the_string_exceed_the_limit()
125 assert_eq!(s.length(), limit); in t_push_cannot_make_the_string_exceed_the_limit()
131 limit in 1usize..1024,
134 let mut s = LimitedString::new(Some(limit));
136 assert!(s.length() <= limit);
141 limit in 1usize..1024,
145 let mut s = LimitedString::new(Some(limit));
147 assert!(s.length() <= limit);
149 assert!(s.length() <= limit);
154 limit in 1usize..1024,
159 let mut s = LimitedString::new(Some(limit));
161 assert!(s.length() <= limit);
163 assert!(s.length() <= limit);
165 assert!(s.length() <= limit);
170 limit in 1usize..1024,
173 let mut s = LimitedString::new(Some(limit));
179 .map(|chr| { s.push(chr); assert!(s.length() <= limit); })