package lablqml

  1. Overview
  2. Docs

Source file testdemo2.ml

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
open Ppxlib

let loc  = Location.none

let wrap_qml _ x = x


let%test _ =
  wrap_qml [%expr qml singleton ~name:"asdf" ]
    true

let%test _ =
  wrap_qml [%expr qml singleton]
    true

let%test _ =
  wrap_qml
    [%expr qml singleton
      ((author: string) Read getAuthor Write setAuthor Notify authorChanged)
      ((author: string) Read getAuthor Write setAuthor Notify authorChanged)
    ]
    true

let%test _ =
  wrap_qml
    [%expr qml singleton
      ((author: string) Read getAuthor Write setAuthor Notify authorChanged)
      ((author: string) Read getAuthor Write setAuthor Notify authorChanged)
    ]
    true


let%test _ =
  wrap_qml
    [%expr qml singleton
       ~name:"MyApi"
       ( (someProperty:int) Read somePropery Write setSomeProperty Notify somePropertyChanged)
    ]
    true
OCaml

Innovation. Community. Security.