summaryrefslogtreecommitdiffstats
path: root/library/cpp/tvmauth/client/ut/logger_ut.cpp
diff options
context:
space:
mode:
authorDevtools Arcadia <[email protected]>2022-02-07 18:08:42 +0300
committerDevtools Arcadia <[email protected]>2022-02-07 18:08:42 +0300
commit1110808a9d39d4b808aef724c861a2e1a38d2a69 (patch)
treee26c9fed0de5d9873cce7e00bc214573dc2195b7 /library/cpp/tvmauth/client/ut/logger_ut.cpp
intermediate changes
ref:cde9a383711a11544ce7e107a78147fb96cc4029
Diffstat (limited to 'library/cpp/tvmauth/client/ut/logger_ut.cpp')
-rw-r--r--library/cpp/tvmauth/client/ut/logger_ut.cpp43
1 files changed, 43 insertions, 0 deletions
diff --git a/library/cpp/tvmauth/client/ut/logger_ut.cpp b/library/cpp/tvmauth/client/ut/logger_ut.cpp
new file mode 100644
index 00000000000..76236e8913b
--- /dev/null
+++ b/library/cpp/tvmauth/client/ut/logger_ut.cpp
@@ -0,0 +1,43 @@
+#include "common.h"
+
+#include <library/cpp/tvmauth/client/logger.h>
+
+#include <library/cpp/testing/unittest/registar.h>
+
+using namespace NTvmAuth;
+
+Y_UNIT_TEST_SUITE(ClientLogger) {
+ int i = 0;
+
+ Y_UNIT_TEST(Debug) {
+ TLogger l;
+ l.Debug("qwerty");
+ UNIT_ASSERT_VALUES_EQUAL("7: qwerty\n", l.Stream.Str());
+ }
+
+ Y_UNIT_TEST(Info) {
+ TLogger l;
+ l.Info("qwerty");
+ UNIT_ASSERT_VALUES_EQUAL("6: qwerty\n", l.Stream.Str());
+ }
+
+ Y_UNIT_TEST(Warning) {
+ TLogger l;
+ l.Warning("qwerty");
+ UNIT_ASSERT_VALUES_EQUAL("4: qwerty\n", l.Stream.Str());
+ }
+
+ Y_UNIT_TEST(Error) {
+ TLogger l;
+ l.Error("qwerty");
+ UNIT_ASSERT_VALUES_EQUAL("3: qwerty\n", l.Stream.Str());
+ }
+
+#ifdef _unix_
+ Y_UNIT_TEST(Cerr_) {
+ TCerrLogger l(5);
+ l.Error("hit");
+ l.Debug("miss");
+ }
+#endif
+}