lower_equal_than Program

program~~lower_equal_than~~UsesGraph program~lower_equal_than lower_equal_than iso_fortran_env iso_fortran_env iso_fortran_env->program~lower_equal_than module~penf_stringify~3 penf_stringify iso_fortran_env->module~penf_stringify~3 module~stringifor stringifor module~stringifor->program~lower_equal_than module~stringifor_string_t stringifor_string_t module~stringifor_string_t->module~stringifor module~penf~3 penf module~penf~3->module~stringifor module~penf~3->module~stringifor_string_t module~befor64 befor64 module~penf~3->module~befor64 module~befor64_pack_data_m~2 befor64_pack_data_m module~penf~3->module~befor64_pack_data_m~2 module~befor64->module~stringifor_string_t module~befor64_pack_data_m~2->module~befor64 module~penf_global_parameters_variables penf_global_parameters_variables module~penf_global_parameters_variables->module~penf~3 module~penf_b_size~4 penf_b_size module~penf_global_parameters_variables->module~penf_b_size~4 module~penf_global_parameters_variables->module~penf_stringify~3 module~penf_b_size~4->module~penf~3 module~penf_b_size~4->module~penf_stringify~3 module~penf_stringify~3->module~penf~3
Help


StringiFor lower_equal_than test.


Source Code


Variables

Type AttributesNameInitial
type(string) :: astring

A string.

type(string) :: anotherstring

A string.

character(len=:), allocatable:: acharacter

A character.

logical :: test_passed(9)

List of passed tests.


Source Code

program lower_equal_than
!-----------------------------------------------------------------------------------------------------------------------------------
!< StringiFor `lower_equal_than` test.
!-----------------------------------------------------------------------------------------------------------------------------------
use, intrinsic :: iso_fortran_env, only : stdout => output_unit
use stringifor, only : string
!-----------------------------------------------------------------------------------------------------------------------------------

!-----------------------------------------------------------------------------------------------------------------------------------
implicit none
type(string)                  :: astring        !< A string.
type(string)                  :: anotherstring  !< A string.
character(len=:), allocatable :: acharacter     !< A character.
logical                       :: test_passed(9) !< List of passed tests.
!-----------------------------------------------------------------------------------------------------------------------------------

!-----------------------------------------------------------------------------------------------------------------------------------
test_passed = .false.

astring = 'one'
anotherstring = 'ONE'
acharacter = 'ONE'
test_passed(1) = ((astring<=anotherstring).eqv..false.)
write(stdout, "(A,L1)") 'Test "'//astring//'<='//anotherstring//'", test passed? ', test_passed(1)
test_passed(2) = ((astring<=acharacter).eqv..false.)
write(stdout, "(A,L1)") 'Test "'//astring//'<='//acharacter//'", test passed? ', test_passed(2)
test_passed(3) = ((acharacter<=astring).eqv..true.)
write(stdout, "(A,L1)") 'Test "'//acharacter//'<='//astring//'", test passed? ', test_passed(3)

astring = 'ONE'
anotherstring = 'one'
acharacter = 'one'
test_passed(4) = ((astring<=anotherstring).eqv..true.)
write(stdout, "(A,L1)") 'Test "'//astring//'<='//anotherstring//'", test passed? ', test_passed(4)
test_passed(5) = ((astring<=acharacter).eqv..true.)
write(stdout, "(A,L1)") 'Test "'//astring//'<='//acharacter//'", test passed? ', test_passed(5)
test_passed(6) = ((acharacter<=astring).eqv..false.)
write(stdout, "(A,L1)") 'Test "'//acharacter//'<='//astring//'", test passed? ', test_passed(6)

astring = 'ONE'
anotherstring = 'ONE'
acharacter = 'ONE'
test_passed(7) = ((astring<=anotherstring).eqv..true.)
write(stdout, "(A,L1)") 'Test "'//astring//'<='//anotherstring//'", test passed? ', test_passed(7)
test_passed(8) = ((astring<=acharacter).eqv..true.)
write(stdout, "(A,L1)") 'Test "'//astring//'<='//acharacter//'", test passed? ', test_passed(8)
test_passed(9) = ((acharacter<=astring).eqv..true.)
write(stdout, "(A,L1)") 'Test "'//acharacter//'<='//astring//'", test passed? ', test_passed(9)

write(stdout, "(A,L1)") new_line('a')//'Are all tests passed? ', all(test_passed)
stop
!-----------------------------------------------------------------------------------------------------------------------------------
endprogram lower_equal_than