summaryrefslogtreecommitdiffstats
path: root/library/core/tests/task.rs
diff options
context:
space:
mode:
Diffstat (limited to 'library/core/tests/task.rs')
-rw-r--r--library/core/tests/task.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/library/core/tests/task.rs b/library/core/tests/task.rs
new file mode 100644
index 000000000..d71fef9e5
--- /dev/null
+++ b/library/core/tests/task.rs
@@ -0,0 +1,14 @@
+use core::task::Poll;
+
+#[test]
+fn poll_const() {
+ // test that the methods of `Poll` are usable in a const context
+
+ const POLL: Poll<usize> = Poll::Pending;
+
+ const IS_READY: bool = POLL.is_ready();
+ assert!(!IS_READY);
+
+ const IS_PENDING: bool = POLL.is_pending();
+ assert!(IS_PENDING);
+}