aboutsummaryrefslogtreecommitdiff
path: root/src/unit/buffer.unit
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2010-06-21 14:56:21 +0000
committerMike Buland <eichlan@xagasoft.com>2010-06-21 14:56:21 +0000
commit6778ed99fe197a05bd109eab1ec047ddcba07ca4 (patch)
tree5e7e82eefaf3cd37cda63697ea78fff0c953d45b /src/unit/buffer.unit
parent97e228c38f312e455e50784146e8a76da7790f97 (diff)
downloadlibbu++-6778ed99fe197a05bd109eab1ec047ddcba07ca4.tar.gz
libbu++-6778ed99fe197a05bd109eab1ec047ddcba07ca4.tar.bz2
libbu++-6778ed99fe197a05bd109eab1ec047ddcba07ca4.tar.xz
libbu++-6778ed99fe197a05bd109eab1ec047ddcba07ca4.zip
Fixed a bug in Bu::Buffer that resulted from a false negative on isEos if the
underlying stream was empty.
Diffstat (limited to 'src/unit/buffer.unit')
-rw-r--r--src/unit/buffer.unit27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/unit/buffer.unit b/src/unit/buffer.unit
new file mode 100644
index 0000000..8ed1ec5
--- /dev/null
+++ b/src/unit/buffer.unit
@@ -0,0 +1,27 @@
1// vim: syntax=cpp
2/*
3 * Copyright (C) 2007-2010 Xagasoft, All rights reserved.
4 *
5 * This file is part of the libbu++ library and is released under the
6 * terms of the license contained in the file LICENSE.
7 */
8
9#include "bu/file.h"
10#include "bu/membuf.h"
11#include "bu/buffer.h"
12
13suite Buffer
14{
15 test emptyFile
16 {
17 Bu::FString sTmp("empty-XXXXXX");
18 Bu::File fEmpty = tempFile(sTmp);
19 Bu::Buffer buf( fEmpty );
20
21 unitTest( buf.isEos() == false );
22 Bu::FString sLine = buf.readLine();
23 unitTest( sLine == "" );
24 unitTest( fEmpty.isEos() == true );
25 unitTest( buf.isEos() == true );
26 }
27}