#include "MAPL_TestErr.h" module Test_ExtDataGridComp use pfunit use mapl3g_ExtDataGridComp_private use generic3g, only: MAPL_HConfigMatch use esmf implicit none private public :: test_merge_hconfig contains @test subroutine test_merge_hconfig() type(ESMF_HConfig) :: hc_main, hc_1, hc_2, expected_config, merged_config integer :: status hc_main = ESMF_HConfigCreate( content=& '{subconfigs: [hc1.yaml, hc2.yaml]}', _RC) hc_1 = ESMF_HConfigCreate(content='{Collections: {foo: {template: filea}}}', _RC) call ESMF_HConfigFileSave(hc_1, "hc1.yaml", _RC) hc_2 = ESMF_HConfigCreate(content='{Collections: {bar: {template: fileb}}}', _RC) call ESMF_HConfigFileSave(hc_2, "hc2.yaml", _RC) expected_config = ESMF_HConfigCreate(content= & '{Collections: {foo: {template: filea}, bar: {template: fileb}}}', _RC) merged_config = ESMF_HConfigCreate(_RC) call merge_config(merged_config, hc_main, _RC) @assertTrue(MAPL_HConfigMatch(merged_config, expected_config)) call ESMF_HConfigDestroy(hc_main, _RC) call ESMF_HConfigDestroy(hc_1, _RC) call ESMF_HConfigDestroy(hc_2, _RC) call ESMF_HConfigDestroy(expected_config, _RC) call ESMF_HConfigDestroy(merged_config, _RC) end subroutine test_merge_hconfig end module Test_ExtDataGridComp