barelymusician/engine/mutable_data_test.cpp
// Tests that mutable data manages complex data as expected.
Tests that mutable data manages complex data as expected.
Tests that mutable data manages complex data as expected .
TEST(MutableDataTest, ComplexData) {
  MutableData<std::vector<std::string>> data;
  EXPECT_TRUE(data.GetScopedView()->empty());
  data.Update({"test", "data"});
  EXPECT_THAT(*data.GetScopedView(), ElementsAre("test", "data"));
  data.Update({"other"});
  {
    const auto view = data.GetScopedView();
    EXPECT_THAT(*view, ElementsAre("other"));
  }
  data.Update({});
  EXPECT_TRUE(data.GetScopedView()->empty());
}
TEST ( MutableDataTest , ComplexData ) { MutableData < std :: vector < std :: string > > data ; EXPECT_TRUE ( data . GetScopedView ( ) -> empty ( ) ) ; data . Update ( { " " , " " } ) ; EXPECT_THAT ( * data . GetScopedView ( ) , ElementsAre ( " " , " " ) ) ; data . Update ( { " " } ) ; { const auto view = data . GetScopedView ( ) ; EXPECT_THAT ( * view , ElementsAre ( " " ) ) ; } data . Update ( { } ) ; EXPECT_TRUE ( data . GetScopedView ( ) -> empty ( ) ) ; }
Tests that mutable data manages complex data as expected.
Tests that mutable data manages complex data as expected .