src_location_ut.cpp 543 B

123456789101112131415161718
  1. #include "src_location.h"
  2. #include <util/string/builder.h>
  3. #include <library/cpp/testing/unittest/registar.h>
  4. static inline TString GenLoc() {
  5. return TStringBuilder() << __LOCATION__;
  6. }
  7. Y_UNIT_TEST_SUITE(TestLocation) {
  8. Y_UNIT_TEST(Test1) {
  9. UNIT_ASSERT_VALUES_EQUAL(GenLoc(), "util/system/src_location_ut.cpp:8");
  10. static constexpr TSourceLocation location = __LOCATION__;
  11. static_assert(location.Line >= 0, "__LOCATION__ can be used at compile time expressions");
  12. }
  13. } // Y_UNIT_TEST_SUITE(TestLocation)