tests/cpp: Add tests for metric.cc
This commit is contained in:
parent
cc859420ba
commit
582c373274
11
tests/cpp/metric/test_metric.cc
Normal file
11
tests/cpp/metric/test_metric.cc
Normal file
@ -0,0 +1,11 @@
|
||||
// Copyright by Contributors
|
||||
#include <xgboost/metric.h>
|
||||
|
||||
#include "../helpers.h"
|
||||
|
||||
TEST(Metric, UnknownMetric) {
|
||||
EXPECT_ANY_THROW(xgboost::Metric::Create("unknown_name"));
|
||||
EXPECT_NO_THROW(xgboost::Metric::Create("rmse"));
|
||||
EXPECT_ANY_THROW(xgboost::Metric::Create("unknown_name@1"));
|
||||
EXPECT_NO_THROW(xgboost::Metric::Create("error@0.5"));
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user