11cb0ef41Sopenharmony_ci#include "node_builtins.h"
21cb0ef41Sopenharmony_ci#include "node_threadsafe_cow-inl.h"
31cb0ef41Sopenharmony_ci
41cb0ef41Sopenharmony_ci#include "gtest/gtest.h"
51cb0ef41Sopenharmony_ci#include "node_test_fixture.h"
61cb0ef41Sopenharmony_ci
71cb0ef41Sopenharmony_ci#include <string>
81cb0ef41Sopenharmony_ci
91cb0ef41Sopenharmony_ciusing node::builtins::BuiltinLoader;
101cb0ef41Sopenharmony_ciusing node::builtins::BuiltinSourceMap;
111cb0ef41Sopenharmony_ci
121cb0ef41Sopenharmony_ciclass PerProcessTest : public ::testing::Test {
131cb0ef41Sopenharmony_ci protected:
141cb0ef41Sopenharmony_ci  static const BuiltinSourceMap get_sources_for_test() {
151cb0ef41Sopenharmony_ci    return *BuiltinLoader().source_.read();
161cb0ef41Sopenharmony_ci  }
171cb0ef41Sopenharmony_ci};
181cb0ef41Sopenharmony_ci
191cb0ef41Sopenharmony_cinamespace {
201cb0ef41Sopenharmony_ci
211cb0ef41Sopenharmony_ciTEST_F(PerProcessTest, EmbeddedSources) {
221cb0ef41Sopenharmony_ci  const auto& sources = PerProcessTest::get_sources_for_test();
231cb0ef41Sopenharmony_ci  ASSERT_TRUE(std::any_of(sources.cbegin(), sources.cend(), [](auto p) {
241cb0ef41Sopenharmony_ci    return p.second.is_one_byte();
251cb0ef41Sopenharmony_ci  })) << "BuiltinLoader::source_ should have some 8bit items";
261cb0ef41Sopenharmony_ci
271cb0ef41Sopenharmony_ci  ASSERT_TRUE(std::any_of(sources.cbegin(), sources.cend(), [](auto p) {
281cb0ef41Sopenharmony_ci    return !p.second.is_one_byte();
291cb0ef41Sopenharmony_ci  })) << "BuiltinLoader::source_ should have some 16bit items";
301cb0ef41Sopenharmony_ci}
311cb0ef41Sopenharmony_ci
321cb0ef41Sopenharmony_ci}  // end namespace
33