test_get_standard_name_from_alias Subroutine

public subroutine test_get_standard_name_from_alias()

Arguments

None

Calls

proc~~test_get_standard_name_from_alias~~CallsGraph proc~test_get_standard_name_from_alias test_get_standard_name_from_alias assert_that assert_that proc~test_get_standard_name_from_alias->assert_that assertequal assertequal proc~test_get_standard_name_from_alias->assertequal none~get_standard_name FieldDictionary%get_standard_name proc~test_get_standard_name_from_alias->none~get_standard_name at at none~get_standard_name->at proc~mapl_return MAPL_Return none~get_standard_name->proc~mapl_return proc~mapl_verify MAPL_Verify none~get_standard_name->proc~mapl_verify proc~mapl_return->at insert insert proc~mapl_return->insert proc~mapl_throw_exception MAPL_throw_exception proc~mapl_return->proc~mapl_throw_exception proc~mapl_verify->proc~mapl_throw_exception

Source Code

   subroutine test_get_standard_name_from_alias()
      type(FieldDictionary) :: fd
      character(:), allocatable :: standard_name
      integer :: status
      
      fd = FieldDictionary(stream= '{' // &
           'X_Y_Z: {canonical_units: m, long_name: "X Y Z", aliases: [x]},' //  &
           'A_B_C: {canonical_units: s, long_name: "A B C", aliases: [a]} }')

      standard_name = fd%get_standard_name('x', rc=status)
      @assert_that(status, is(0))
      @assertEqual('X_Y_Z', standard_name)

      standard_name = fd%get_standard_name('a', rc=status)
      @assert_that(status, is(0))
      @assertEqual('A_B_C', standard_name)

   end subroutine test_get_standard_name_from_alias