InfiniTensor/test/nnet/test_subset.cc

19 lines
451 B
C++
Raw Normal View History

2022-08-08 16:02:07 +08:00
#include "nnet/dlt.h"
#include "nnet/expr.h"
#include "nnet/permutation.h"
#include "gtest/gtest.h"
using namespace nnet;
using namespace std;
#define DEFINE_VAR(name) auto name = make_ref<VarNode>(#name);
TEST(Subset, Simple) {
SubsetGenerator<string> gen{{"a", "b", "c"}};
int cnt = 0;
do {
++cnt;
if (cnt == 1) {
EXPECT_EQ(gen.get()[0], "a");
}
} while (gen.next());
EXPECT_EQ(cnt, 8 - 2);
}