aboutsummaryrefslogtreecommitdiffstats
path: root/util/system/pipe_ut.cpp
blob: 7bd6ed0c577f325fca0a5d01393e59b23a15e1e8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "pipe.h"

#include <library/cpp/testing/unittest/registar.h> 

Y_UNIT_TEST_SUITE(TPipeTest) {
    Y_UNIT_TEST(TestPipe) {
        TPipe r;
        TPipe w;
        TPipe::Pipe(r, w);
        char c = 'a';
        UNIT_ASSERT(1 == w.Write(&c, 1));
        UNIT_ASSERT(1 == r.Read(&c, 1));
        UNIT_ASSERT_VALUES_EQUAL('a', c);
    }
}