Skip to content

Commit 52a49cb

Browse files
committed
add a populate() valid test
1 parent de3a142 commit 52a49cb

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

cpp08/ex01/src/main.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ main ()
3131
}
3232
}
3333
{
34-
3534
print (SUB_TITTLE GREEN
3635
"Exception when try to fill out of bounds - populate()\n" RESET);
3736
Span sp = Span (5);
@@ -45,6 +44,14 @@ main ()
4544
print (e.what ());
4645
}
4746
}
47+
{
48+
print (SUB_TITTLE GREEN "populate() with a valid range\n" RESET);
49+
Span sp = Span (10);
50+
std::vector<int> v (10, -42);
51+
52+
sp.populate (v.begin (), v.end ());
53+
sp.operator<< (std::cout);
54+
}
4855
{
4956
print (SUB_TITTLE GREEN "Exception when try to calculate shortestSpan() "
5057
"with less than 2 numbers\n" RESET);

0 commit comments

Comments
 (0)