File: test_g

package info (click to toggle)
haskell-futhark 0.25.32-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 18,236 kB
  • sloc: haskell: 100,484; ansic: 12,100; python: 3,440; yacc: 785; sh: 561; javascript: 558; lisp: 399; makefile: 277
file content (20 lines) | stat: -rwxr-xr-x 290 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env python3

import g
import numpy as np

obj = g.g()

n = 1
m = 1000

vec_n = obj.mk_vec(n)
vec_m = obj.mk_vec(m)

assert(obj.use_vec(vec_n, vec_n) == 0)

try:
    obj.use_vec(vec_n, vec_m) # Should fail.
    assert(False)
except Exception as e:
    assert('invalid' in str(e))