aboutsummaryrefslogtreecommitdiff
path: root/src/unit/buffer.unit
diff options
context:
space:
mode:
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}