From b90e65cce695fb0b96174c8ee56934e6631d4469 Mon Sep 17 00:00:00 2001 From: Emmanuel Nyarko Date: Wed, 24 Apr 2024 14:52:41 +0000 Subject: [PATCH] add simple tests for list(size, value) ctor and get_allocator function --- source/stdcpp/test/list.d | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source/stdcpp/test/list.d b/source/stdcpp/test/list.d index aef2f0a..d633eb0 100644 --- a/source/stdcpp/test/list.d +++ b/source/stdcpp/test/list.d @@ -33,7 +33,7 @@ unittest p.resize(3); assert(p.size == 3); - list!int cp_obj = p; //opAssign + list!int cp_obj = p; // copy ctor assert(cp_obj.size == 3); cp_obj.clear(); cp_obj.push_back(45); @@ -41,3 +41,11 @@ unittest assert(cp_obj.front == 45); assert(cp_obj.back == 56); } + +unittest +{ + import stdcpp.allocator; + allocator!int alloc_instance = allocator!(int).init; + auto q = list!int(8, 9); + assert(q.get_allocator == alloc_instance); +}