File: type.rb

package info (click to toggle)
ruby-netcdf 0.8.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 924 kB
  • sloc: ansic: 4,024; ruby: 1,884; csh: 6; makefile: 6
file content (29 lines) | stat: -rw-r--r-- 591 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
require 'test/unit'
require 'numru/netcdf'
include NumRu
class TestType < Test::Unit::TestCase
  def test_type
    @s = 'tmp.nc'
    f = NetCDF.create(@s)
    d = f.def_dim('x',2)
    v = f.def_var('x','sfloat',[d])
    assert_equal v.vartype,
                 v.ntype
    v = f.def_var('x1','sint',[d])
    assert_equal v.vartype,
                 v.ntype
    v = f.def_var('x2','byte',[d])
    assert_equal v.vartype,
                 v.ntype
    f.close
  end
  def teardown
    if File.exist?(@s)
      begin
        File.delete(@s)
      rescue
        p $!
      end
    end
  end
end