| 122 | }; |
| 123 | |
| 124 | TEST(DataProcessorTransformTest, UpsertCreatesNamedTopic) { |
| 125 | Fixture fx; |
| 126 | fx.seed("speed", {-1.0, 2.0, -3.0}); |
| 127 | |
| 128 | const auto rec = fx.service.upsertTransform("pluginA", "negate", {"speed"}, {"speed/negated"}, kNegate, "{}"); |
| 129 | ASSERT_TRUE(rec.has_value()) << rec.error(); |
| 130 | EXPECT_EQ(rec->key, "pluginA/negate"); |
| 131 | EXPECT_EQ(rec->owner_plugin, "pluginA"); |
| 132 | EXPECT_EQ(rec->user_id, "negate"); |
| 133 | EXPECT_EQ(rec->backend, "luau"); |
| 134 | EXPECT_EQ(rec->dataset_id, fx.ds); // output dataset = the input topic's dataset |
| 135 | ASSERT_EQ(rec->output_topic_ids.size(), 1u); |
| 136 | |
| 137 | const TopicId out = rec->output_topic_ids.front(); |
| 138 | EXPECT_TRUE(fx.listed(out)); |
| 139 | EXPECT_EQ(readValues(fx.engine, out), (std::vector<double>{1.0, -2.0, 3.0})); |
| 140 | } |
| 141 | |
| 142 | TEST(DataProcessorTransformTest, UpsertReplacesExistingNode) { |
| 143 | Fixture fx; |
nothing calls this directly
no test coverage detected