summaryrefslogtreecommitdiff
path: root/LA/Test/MatrixXT/MatrixXT.swift
blob: 55661be9522fab7f5fac4450439c58763e1f6153 (plain) (blame)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//
//  MatrixXT.swift
//  MatrixXT
//
//  Created by Jacky Jack on 21/10/2024.
//

import Testing

struct MatrixXT {

    @Test func example() async throws {
        // Write your test here and use APIs like `#expect(...)` to check expected conditions.
    }
    
    @Test func matrix_create_with_init() async throws {
        do {
            let _ = try Matrix(row:-1,column: -1,val:0.0)
            Issue.record("Should fail")
        } catch {
            //should allway get here,
        }
        do {
            let _ = try Matrix(row: 0, column: 0, val: 0.0)
            Issue.record("Should fail")
        } catch {
            //should allways get here
        }
        do {
            let _ = try Matrix(row: 1, column: 1, val: 0.0)
        } catch {
            Issue.record("Failed")
        }
        
        do {
            let _ = try Matrix(row: 2, column: 2, val: 0.0)
        } catch {
            Issue.record("Failed")
        }
        do {
            let _ = try Matrix(row: 3, column: 3, val: 0.0)
        } catch {
            Issue.record("Failed")
        }
        do {
            let _ = try Matrix(row:16, column: 16, val: 0.0)
        } catch {
            Issue.record("Failed")
        }
        
}

}