Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions examples/yaml_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

int main() {
// reading a lattice from a yaml file
YAMLNodeHandle handle = yaml_parse_file("../lattice_files/ex.yaml");
YAMLNodeHandle handle = yaml_parse_file("../lattice_files/ex.pals.yaml");
// printing to terminal
std::cout << yaml_to_string(handle) << std::endl << std::endl;

Expand Down Expand Up @@ -33,6 +33,6 @@ int main() {
yaml_push_node(handle, map);
yaml_push_node(handle, sequence);

// writing modified lattice file to expand.yaml
yaml_write_file(handle, "../lattice_files/expand.yaml");
}
// writing modified lattice file to expand.pals.yaml
yaml_write_file(handle, "../lattice_files/expand.pals.yaml");
}
File renamed without changes.
14 changes: 7 additions & 7 deletions tests/test_yaml_c_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ TEST_CASE("YAML can be parsed from strings", "[parsing]") {

TEST_CASE("YAML can be parsed from files", "[parsing][file]") {
SECTION("Parse valid file") {
YAMLNodeHandle node = yaml_parse_file("../lattice_files/ex.yaml");
YAMLNodeHandle node = yaml_parse_file("../lattice_files/ex.pals.yaml");

REQUIRE(node != nullptr);
REQUIRE(yaml_is_sequence(node));
Expand All @@ -108,7 +108,7 @@ TEST_CASE("YAML can be parsed from files", "[parsing][file]") {
}

SECTION("Parse non-existent file returns nullptr") {
YAMLNodeHandle node = yaml_parse_file("nonexistent.yaml");
YAMLNodeHandle node = yaml_parse_file("nonexistent.pals.yaml");
REQUIRE(node == nullptr);
}
}
Expand Down Expand Up @@ -483,7 +483,7 @@ TEST_CASE("Scalar values can be edited directly", "[modification][scalar]") {
// ===========================================

TEST_CASE("YAML can be written to files", "[io][file]") {
const char* test_file = "test_output.yaml";
const char* test_file = "test_output.pals.yaml";

SECTION("Write simple map") {
YAMLNodeHandle map = yaml_create_map();
Expand Down Expand Up @@ -600,11 +600,11 @@ TEST_CASE("YAML nodes can be cloned", "[clone]") {
}

// ===========================================
// TEST SUITE: ex.yaml Structure Tests
// TEST SUITE: ex.pals.yaml Structure Tests
// ===========================================

TEST_CASE("ex.yaml has expected structure", "[ex.yaml][structure]") {
YAMLNodeHandle root = yaml_parse_file("../lattice_files/ex.yaml");
TEST_CASE("ex.pals.yaml has expected structure", "[ex.pals.yaml][structure]") {
YAMLNodeHandle root = yaml_parse_file("../lattice_files/ex.pals.yaml");
REQUIRE(root != nullptr);

SECTION("Root is a sequence") {
Expand Down Expand Up @@ -742,4 +742,4 @@ TEST_CASE("Edge cases are handled correctly", "[edge_cases]") {
yaml_set_scalar_string(scalar, nullptr); // Should not crash
yaml_delete_node(scalar);
}
}
}