From 153b34e490032d22fa71a7125fb78a120f9f848d Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 10 Aug 2023 00:04:24 -0700 Subject: Added some handy operators to Bu::BlobBuilder --- src/unit/blobbuilder.unit | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'src/unit') diff --git a/src/unit/blobbuilder.unit b/src/unit/blobbuilder.unit index c9480bb..30aece7 100644 --- a/src/unit/blobbuilder.unit +++ b/src/unit/blobbuilder.unit @@ -17,13 +17,11 @@ suite BlobBuilder { test append { - Bu::BlobBuilder a; a.append("a"); a.append("bc"); a += "def"; a.append("abcdef"); - } test appendChar @@ -35,4 +33,23 @@ suite BlobBuilder } unitTest( a.getBlob() == "AAAAAAAAAAAAAAAAAAAA" ); } + + test operators1 + { + Bu::BlobBuilder a; + + a << "Hello" << " " << Bu::Blob("there") << " how are you?"; + unitTest( a.getBlob() == "Hello there how are you?" ); + } + + test operators2 + { + Bu::BlobBuilder a; + + a += "Hello"; + a += " "; + a += Bu::Blob("there"); + a += " how are you?"; + unitTest( a.getBlob() == "Hello there how are you?" ); + } } -- cgit v1.2.3