Cortenn
Classes | Macros | Functions
test_shear.cpp File Reference
#include "gtest/gtest.h"
#include "dbg/ade.hpp"
#include "opt/shear.hpp"
Include dependency graph for test_shear.cpp:

Classes

struct  MockTensor
 

Macros

#define TREE_EQ(expectstr, root, labels)
 

Functions

static void ltrim (std::string &s)
 
static void rtrim (std::string &s)
 
static void trim (std::string &s)
 
 TEST (SHEAR, Prune)
 

Macro Definition Documentation

◆ TREE_EQ

#define TREE_EQ (   expectstr,
  root,
  labels 
)
Value:
{\
PrettyEquation artist;\
artist.showshape_ = true;\
artist.labels_ = labels;\
std::stringstream gotstr;\
artist.print(gotstr, root);\
std::string expect;\
std::string got;\
std::string line;\
while (std::getline(expectstr, line))\
{\
trim(line);\
if (line.size() > 0)\
{\
expect += line + "\n";\
}\
}\
while (std::getline(gotstr, line))\
{\
trim(line);\
if (line.size() > 0)\
{\
got += line + "\n";\
}\
}\
EXPECT_STREQ(expect.c_str(), got.c_str());\
}

Function Documentation

◆ ltrim()

static void ltrim ( std::string &  s)
inlinestatic

◆ rtrim()

static void rtrim ( std::string &  s)
inlinestatic

◆ TEST()

TEST ( SHEAR  ,
Prune   
)

◆ trim()

static void trim ( std::string &  s)
inlinestatic