@@ -446,5 +446,44 @@ namespace xtd::tests {
446
446
assert::are_equal (a.data (), s.data ());
447
447
assert::are_equal (10 , *s.data ());
448
448
}
449
+
450
+ void test_method_ (empty) {
451
+ auto a = array {10 , 20 , 30 , 40 , 50 };
452
+ auto s = span (a);
453
+ assert::is_false (s.empty ());
454
+ assert::is_true (span<int > {}.empty ());
455
+ assert::is_true (span<int >::empty_span.empty ());
456
+ }
457
+
458
+ void test_method_ (empty_span) {
459
+ assert::is_null (span<int >::empty_span.data ());
460
+ assert::is_zero (span<int >::empty_span.size ());
461
+ }
462
+
463
+ void test_method_ (const_end) {
464
+ auto a = array {10 , 20 , 30 , 40 , 50 };
465
+ const auto s = span (a);
466
+ assert::are_equal (s.data () + 5 , s.end ().data ());
467
+ }
468
+
469
+ void test_method_ (end) {
470
+ auto a = array {10 , 20 , 30 , 40 , 50 };
471
+ auto s = span (a);
472
+ assert::are_equal (s.data () + 5 , s.end ().data ());
473
+ }
474
+
475
+ void test_method_ (front) {
476
+ auto a = array {10 , 20 , 30 , 40 , 50 };
477
+ auto s = span (a);
478
+ assert::are_equal (10 , s.front ());
479
+ }
480
+
481
+ void test_method_ (is_empty) {
482
+ auto a = array {10 , 20 , 30 , 40 , 50 };
483
+ auto s = span (a);
484
+ assert::is_false (s.is_empty ());
485
+ assert::is_true (span<int > {}.is_empty ());
486
+ assert::is_true (span<int >::empty_span.is_empty ());
487
+ }
449
488
};
450
489
}
0 commit comments