~ubuntu-branches/ubuntu/natty/lua-gtk/natty

« back to all changes in this revision

Viewing changes to tests/019-pango_tab_array.lua

  • Committer: Bazaar Package Importer
  • Author(s): Enrico Tassi
  • Date: 2009-05-17 18:16:21 UTC
  • mfrom: (1.2.1 upstream) (4.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20090517181621-9kmdd82nxg54jsio
* new upstream snapshot comprising many more GNOME libraries:
    Gtk, GDK, GLib, Pango, Atk, Libxml2, Cairo, Clutter, Gtkhtml, 
    GtkSourceView, Gio, Gtkspell and GConf. 
* new upstream release includes a new configure script written in Lua,
  no more bashisms there (Closes: #507205)
* renamed binary packages to liblua5.1-gnome-*
* updated standards-version to 3.8.1, no changes needed
* patch to load .so.* version of libraries and not .so (that was requiring
  -dev packages) (Closes: #522087)
* removed redundant Architecture line from the source stanza of control
  (Closes: #498120)
* updated copyright file, Wolfgang Oertl holds it for 2009 too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! /usr/bin/env lua
2
 
require "gtk"
 
2
-- vim:sw=4:sts=4
 
3
 
 
4
require "pango"
3
5
 
4
6
-- test pango_tab_array functions, especially pango_tab_array_get_tabs,
5
7
-- which has a special override function.
6
8
 
7
 
ta = gtk.pango_tab_array_new_with_positions(2, true,
8
 
        gtk.PANGO_TAB_LEFT, 10,
9
 
        gtk.PANGO_TAB_LEFT, 30)
 
9
ta = pango.tab_array_new_with_positions(2, true,
 
10
        pango.TAB_LEFT, 10,
 
11
        pango.TAB_LEFT, 30)
10
12
assert(ta:get_size() == 2)
11
13
 
12
 
a, b = ta:get_tab(0, 0, nil)
13
 
assert(a == gtk.PANGO_TAB_LEFT)
 
14
gnome.set_debug_flags "trace"
 
15
a, b = ta:get_tab(0, 0, 0)
 
16
assert(a == pango.TAB_LEFT)
14
17
assert(b == 10)
15
18
 
16
 
ta:set_tab(0, gtk.PANGO_TAB_LEFT, 15)
 
19
ta:set_tab(0, pango.TAB_LEFT, 15)
 
20
-- ta:set_tab(1, pango.TAB_LEFT, 30)
17
21
 
18
 
a, b = ta:get_tab(0, 0, nil)
19
 
assert(a == gtk.PANGO_TAB_LEFT)
 
22
a, b = ta:get_tab(0, 0, 0)
 
23
assert(a == pango.TAB_LEFT)
20
24
assert(b == 15)
21
25
 
22
26
ar1 = {}
28
31
assert(#ar1 == 2)
29
32
assert(#ar2 == 2)
30
33
 
31
 
assert(ar1[1] == gtk.PANGO_TAB_LEFT)
32
 
assert(ar1[2] == gtk.PANGO_TAB_LEFT)
 
34
assert(ar1[1] == pango.TAB_LEFT)
 
35
assert(ar1[2] == pango.TAB_LEFT)
33
36
 
34
37
assert(ar2[1] == 15)
35
38
assert(ar2[2] == 30)