aboutsummaryrefslogtreecommitdiff
path: root/crates/test_utils/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-06-17 09:18:37 +0100
committerAleksey Kladov <[email protected]>2021-06-17 09:18:37 +0100
commit9b3aa591cd0672e9b7bdf3e5aab630cd09a4d546 (patch)
tree49823cdc42e5bac3f6079fe6093eae07b9f68efd /crates/test_utils/src
parent7b4f5c0262bbdf7e9db81734eb9c82dd04eb82cb (diff)
internal: switch some tests to minicore
Diffstat (limited to 'crates/test_utils/src')
-rw-r--r--crates/test_utils/src/fixture.rs2
-rw-r--r--crates/test_utils/src/minicore.rs34
2 files changed, 35 insertions, 1 deletions
diff --git a/crates/test_utils/src/fixture.rs b/crates/test_utils/src/fixture.rs
index 005a5c092..8d8f3b560 100644
--- a/crates/test_utils/src/fixture.rs
+++ b/crates/test_utils/src/fixture.rs
@@ -154,7 +154,7 @@ impl Fixture {
154 let components = meta.split_ascii_whitespace().collect::<Vec<_>>(); 154 let components = meta.split_ascii_whitespace().collect::<Vec<_>>();
155 155
156 let path = components[0].to_string(); 156 let path = components[0].to_string();
157 assert!(path.starts_with('/')); 157 assert!(path.starts_with('/'), "fixture path does not start with `/`: {:?}", path);
158 158
159 let mut krate = None; 159 let mut krate = None;
160 let mut deps = Vec::new(); 160 let mut deps = Vec::new();
diff --git a/crates/test_utils/src/minicore.rs b/crates/test_utils/src/minicore.rs
index 2f0da7fe5..1a0573d7a 100644
--- a/crates/test_utils/src/minicore.rs
+++ b/crates/test_utils/src/minicore.rs
@@ -228,6 +228,28 @@ pub mod iter {
228 } 228 }
229 pub use self::adapters::Take; 229 pub use self::adapters::Take;
230 230
231 mod sources {
232 mod repeat {
233 pub fn repeat<T>(elt: T) -> Repeat<T> {
234 loop {}
235 }
236
237 pub struct Repeat<A> {
238 element: A,
239 }
240
241 impl<A> Iterator for Repeat<A> {
242 type Item = A;
243
244 fn next(&mut self) -> Option<A> {
245 loop {}
246 }
247 }
248 }
249 pub use self::repeat::{repeat, Repeat};
250 }
251 pub use self::sources::{repeat, Repeat};
252
231 mod traits { 253 mod traits {
232 mod iterator { 254 mod iterator {
233 use super::super::Take; 255 use super::super::Take;
@@ -242,6 +264,18 @@ pub mod iter {
242 fn take(self, n: usize) -> crate::iter::Take<Self> { 264 fn take(self, n: usize) -> crate::iter::Take<Self> {
243 loop {} 265 loop {}
244 } 266 }
267 fn by_ref(&mut self) -> &mut Self
268 where
269 Self: Sized,
270 {
271 self
272 }
273 }
274 impl<I: Iterator + ?Sized> Iterator for &mut I {
275 type Item = I::Item;
276 fn next(&mut self) -> Option<I::Item> {
277 (**self).next()
278 }
245 } 279 }
246 } 280 }
247 pub use self::iterator::Iterator; 281 pub use self::iterator::Iterator;