@@ -99,17 +99,19 @@ function test_write(T)
9999 add_var (ds, 0.5 : 1 : 9.5 , " lon" , (" lon" ,), Dict (" units" => " degrees_east" ))
100100 add_var (ds, 20 : - 1.0 : 1 , " lat" , (" lat" ,), Dict (" units" => " degrees_north" ))
101101 v = add_var (ds, Float32, " tas" , (10 ,20 ), (" lon" , " lat" ), Dict {String,Any} (" units" => " Celsius" ))
102-
102+ w = add_var (ds, Rational{Int}, " tas2 " , ( 10 , 20 ), ( " lon " , " lat " ), Dict {String,Any} ( " units " => " Celsius " ))
103103 v[:,:] = collect (reshape (1 : 200 , 10 , 20 ))
104-
105- @test sort (get_varnames (ds)) == [" lat" ," lon" ," tas" ]
104+ w[:,:] = collect ( reshape ( 1 : 200 , 10 , 20 )) .// 2
105+ @test sort (get_varnames (ds)) == [" lat" ," lon" ," tas" , " tas2 " ]
106106 @test get_var_dims (ds, " tas" ) == [" lon" , " lat" ]
107107 @test get_var_dims (ds, " lon" ) == [" lon" ]
108108 @test get_var_attrs (ds," tas" )[" units" ] == " Celsius"
109109 h = get_var_handle (ds, " lon" )
110110 @test h[:] == 0.5 : 1 : 9.5
111111 v = get_var_handle (ds, " tas" )
112112 @test v[1 : 2 ,1 : 2 ] == [1 11 ; 2 12 ]
113+ w = get_var_handle (ds, " tas2" )
114+ @test w[1 : 2 ,1 : 2 ] == [1 11 ; 2 12 ] .// 2
113115end
114116
115117@testset " Writing NetCDF" begin
0 commit comments