summary refs log tree commit diff stats
path: root/tests/accept/compile
diff options
context:
space:
mode:
authorAndreas Rumpf <andreas@andreas-laptop>2010-03-14 01:25:25 +0100
committerAndreas Rumpf <andreas@andreas-laptop>2010-03-14 01:25:25 +0100
commit7bf98411b6d4dfd203371b5d2ec0a5ef3a2305df (patch)
tree23f76f650800ca9508e17869cc83fc8061d1f310 /tests/accept/compile
parent3dafd6856bfd644e9cf518b36e5bfedc3220a702 (diff)
downloadNim-7bf98411b6d4dfd203371b5d2ec0a5ef3a2305df.tar.gz
version 0.8.8
Diffstat (limited to 'tests/accept/compile')
-rwxr-xr-xtests/accept/compile/tconvcolors.nim5
-rwxr-xr-xtests/accept/compile/tdialogs.nim2
-rwxr-xr-xtests/accept/compile/tgtk.nim40
-rwxr-xr-xtests/accept/compile/tlexer.nim2
-rwxr-xr-xtests/accept/compile/tlibs.nim5
-rw-r--r--tests/accept/compile/tnoargopenarray.nim7
6 files changed, 33 insertions, 28 deletions
diff --git a/tests/accept/compile/tconvcolors.nim b/tests/accept/compile/tconvcolors.nim
new file mode 100755
index 000000000..07e829550
--- /dev/null
+++ b/tests/accept/compile/tconvcolors.nim
@@ -0,0 +1,5 @@
+
+import colors
+
+echo int32(colWhite), 'A'
+
diff --git a/tests/accept/compile/tdialogs.nim b/tests/accept/compile/tdialogs.nim
index 90f241cdf..d161a976d 100755
--- a/tests/accept/compile/tdialogs.nim
+++ b/tests/accept/compile/tdialogs.nim
@@ -2,7 +2,7 @@
 
 import dialogs, gtk2
 
-gtk_nimrod_init()
+gtk2.nimrod_init()
 
 var x = ChooseFilesToOpen(nil)
 for a in items(x):
diff --git a/tests/accept/compile/tgtk.nim b/tests/accept/compile/tgtk.nim
index cd9254e4f..7febb0ab8 100755
--- a/tests/accept/compile/tgtk.nim
+++ b/tests/accept/compile/tgtk.nim
@@ -3,10 +3,10 @@ import
   gtk2, glib2, atk, gdk2, gdk2pixbuf, libglade2, pango,

   pangoutils

 

-proc hello(widget: PGtkWidget, data: pointer) {.cdecl.} =

+proc hello(widget: PWidget, data: pointer) {.cdecl.} =

   write(stdout, "Hello World\n")

 

-proc delete_event(widget: PGtkWidget, event: PGdkEvent,

+proc delete_event(widget: PWidget, event: PEvent,

                   data: pointer): bool {.cdecl.} =

   # If you return FALSE in the "delete_event" signal handler,

   # GTK will emit the "destroy" signal. Returning TRUE means

@@ -19,43 +19,33 @@ proc delete_event(widget: PGtkWidget, event: PGdkEvent,
   return false

 

 # Another callback

-proc destroy(widget: PGtkWidget, data: pointer) {.cdecl.} =

-  gtk_main_quit()

+proc mydestroy(widget: PWidget, data: pointer) {.cdecl.} =

+  gtk2.main_quit()

 

-proc main() =

+proc mymain() =

   # GtkWidget is the storage type for widgets

-  var

-    window: PGtkWindow 

-    button: PGtkButton

-

-  gtk_nimrod_init()

-  window = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL))

+  gtk2.nimrod_init()

+  var window = window_new(gtk2.WINDOW_TOPLEVEL)

   discard g_signal_connect(window, "delete_event", 

                            Gcallback(delete_event), nil)

-  discard g_signal_connect(window, "destroy", Gcallback(destroy), nil)

+  discard g_signal_connect(window, "destroy", Gcallback(mydestroy), nil)

   # Sets the border width of the window.

-  gtk_container_set_border_width(window, 10)

+  set_border_width(window, 10)

 

   # Creates a new button with the label "Hello World".

-  button = GTK_BUTTON(gtk_button_new_with_label("Hello World"))

+  var button = button_new("Hello World")

 

   discard g_signal_connect(button, "clicked", Gcallback(hello), nil)

 

-  # This will cause the window to be destroyed by calling

-  # gtk_widget_destroy(window) when "clicked".  Again, the destroy

-  # signal could come from here, or the window manager.

-  discard g_signal_connect_swapped(button, "clicked", 

-    Gcallback(gtk_widget_destroy), window)

-

   # This packs the button into the window (a gtk container).

-  gtk_container_add(window, button)

+  add(window, button)

 

   # The final step is to display this newly created widget.

-  gtk_widget_show(button)

+  show(button)

 

   # and the window

-  gtk_widget_show(window)

+  show(window)

 

-  gtk_main()

+  gtk2.main()

 

-main()

+mymain()

diff --git a/tests/accept/compile/tlexer.nim b/tests/accept/compile/tlexer.nim
index fe784280c..f0fac8ec4 100755
--- a/tests/accept/compile/tlexer.nim
+++ b/tests/accept/compile/tlexer.nim
@@ -18,7 +18,7 @@ proc splitText(txt: string): seq[string] # splits a text into several lines
                                          # the comment continues here

                                          # this is not easy to parse!

 

-proc anotherSplit(txt: string): list[string] =

+proc anotherSplit(txt: string): seq[string] =

   # the comment should belong to `anotherSplit`!

   # another problem: comments are statements!

 

diff --git a/tests/accept/compile/tlibs.nim b/tests/accept/compile/tlibs.nim
index e3b6bd4c3..990d6e58d 100755
--- a/tests/accept/compile/tlibs.nim
+++ b/tests/accept/compile/tlibs.nim
@@ -12,7 +12,10 @@ import
   cairowin32, cairoxlib,
   odbcsql,
   gl, glut, glu, glx, glext, wingl,
-  lua, lualib, lauxlib, mysql, sqlite3, python, tcl
+  lua, lualib, lauxlib, mysql, sqlite3, python, tcl,
+  db_postgres, db_mysql, db_sqlite, ropes, sockets, browsers, httpserver,
+  httpclient, parseutils, unidecode, xmldom, xmldomparser, xmltree, xmlparser,
+  htmlparser, re, graphics, colors
   
 when defined(linux):
   import
diff --git a/tests/accept/compile/tnoargopenarray.nim b/tests/accept/compile/tnoargopenarray.nim
new file mode 100644
index 000000000..872ec86d2
--- /dev/null
+++ b/tests/accept/compile/tnoargopenarray.nim
@@ -0,0 +1,7 @@
+
+import db_sqlite
+
+var db: TDbConn
+Exec(db, sql"create table blabla()")
+
+