pipe_ut.cpp 378 B

123456789101112131415
  1. #include "pipe.h"
  2. #include <library/cpp/testing/unittest/registar.h>
  3. Y_UNIT_TEST_SUITE(TPipeTest) {
  4. Y_UNIT_TEST(TestPipe) {
  5. TPipe r;
  6. TPipe w;
  7. TPipe::Pipe(r, w);
  8. char c = 'a';
  9. UNIT_ASSERT(1 == w.Write(&c, 1));
  10. UNIT_ASSERT(1 == r.Read(&c, 1));
  11. UNIT_ASSERT_VALUES_EQUAL('a', c);
  12. }
  13. } // Y_UNIT_TEST_SUITE(TPipeTest)