/+junk/gjs-vapi

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/%2Bjunk/gjs-vapi

« back to all changes in this revision

Viewing changes to test.vala

  • Committer: Gustav Hartvigsson
  • Date: 2021-09-13 16:00:35 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20210913160035-1pyul5jso24apzdb
More code.
* Wrote a simple test.
* fixed the VAPI file so it actually works.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
using Gjs;
 
2
 
 
3
int main (string[] args) {
 
4
  try {
 
5
    var grcs = GLib.Resource.load ("./gjs.vapi.test.gresource");
 
6
    grcs._register ();
 
7
  } catch (GLib.Error e) {
 
8
    print (e.message + "\n");
 
9
  }
 
10
  
 
11
  var ctx = new Context.with_search_path ({"resource:///gjs/test/vapi/test/",
 
12
                                            null});
 
13
  int i;
 
14
  
 
15
  try {
 
16
    var b = ctx.eval_file ("test.js", out i);
 
17
    b = bool.parse (b.to_string ());
 
18
  } catch (GLib.Error e) {
 
19
    print (e.message + "\n");
 
20
  }
 
21
  return 0;
 
22
}