diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/accept/compile/mrecmod.nim (renamed from tests/mrecmod.nim) | 0 | ||||
-rw-r--r-- | tests/accept/compile/mrecmod2.nim (renamed from tests/mrecmod2.nim) | 0 | ||||
-rw-r--r-- | tests/accept/run/mambsys1.nim (renamed from tests/mambsys1.nim) | 0 | ||||
-rw-r--r-- | tests/accept/run/mambsys2.nim (renamed from tests/mambsys2.nim) | 0 | ||||
-rw-r--r-- | tests/accept/run/minit.nim (renamed from tests/minit.nim) | 0 | ||||
-rw-r--r-- | tests/cairotest.nim | 14 | ||||
-rw-r--r-- | tests/cgitest.nim | 15 | ||||
-rw-r--r-- | tests/curltest.nim | 10 | ||||
-rw-r--r-- | tests/gtk/ex1.nim | 14 | ||||
-rw-r--r-- | tests/gtk/ex2.nim | 21 | ||||
-rw-r--r-- | tests/gtk/ex3.nim | 39 | ||||
-rw-r--r-- | tests/gtk/ex4.nim | 31 | ||||
-rw-r--r-- | tests/gtk/ex5.nim | 24 | ||||
-rw-r--r-- | tests/gtk/ex6.nim | 52 | ||||
-rw-r--r-- | tests/gtk/ex7.nim | 43 | ||||
-rw-r--r-- | tests/gtk/ex8.nim | 32 | ||||
-rw-r--r-- | tests/gtk/ex9.nim | 47 | ||||
-rw-r--r-- | tests/hallo.nim | 34 | ||||
-rw-r--r-- | tests/reject/mambsym1.nim (renamed from tests/mambsym1.nim) | 0 | ||||
-rw-r--r-- | tests/reject/mambsym2.nim (renamed from tests/mambsym2.nim) | 0 | ||||
-rw-r--r-- | tests/reject/mnamspc1.nim (renamed from tests/mnamspc1.nim) | 0 | ||||
-rw-r--r-- | tests/reject/mnamspc2.nim (renamed from tests/mnamspc2.nim) | 0 | ||||
-rw-r--r-- | tests/reject/mopaque.nim (renamed from tests/mopaque.nim) | 0 | ||||
-rw-r--r-- | tests/reject/tatomic.nim | 5 | ||||
-rw-r--r-- | tests/sdltest.nim | 26 | ||||
-rw-r--r-- | tests/testdata/csvtest.csv (renamed from tests/csvtest.csv) | 0 | ||||
-rw-r--r-- | tests/testdata/data.csv (renamed from tests/data.csv) | 0 | ||||
-rw-r--r-- | tests/testdata/doc1.xml | 14 | ||||
-rw-r--r-- | tests/testdata/jsontest.json (renamed from tests/jsontest.json) | 0 | ||||
-rw-r--r-- | tests/testdata/wildhtml.html (renamed from tests/wildhtml.html) | 0 | ||||
-rw-r--r-- | tests/testdata/xmltest.html (renamed from tests/xmltest.html) | 0 | ||||
-rw-r--r-- | tests/wingui.nim | 9 | ||||
-rw-r--r-- | tests/x11test.nim | 71 |
33 files changed, 19 insertions, 482 deletions
diff --git a/tests/mrecmod.nim b/tests/accept/compile/mrecmod.nim index fab9654d5..fab9654d5 100644 --- a/tests/mrecmod.nim +++ b/tests/accept/compile/mrecmod.nim diff --git a/tests/mrecmod2.nim b/tests/accept/compile/mrecmod2.nim index 9557ce729..9557ce729 100644 --- a/tests/mrecmod2.nim +++ b/tests/accept/compile/mrecmod2.nim diff --git a/tests/mambsys1.nim b/tests/accept/run/mambsys1.nim index 5472b5ae4..5472b5ae4 100644 --- a/tests/mambsys1.nim +++ b/tests/accept/run/mambsys1.nim diff --git a/tests/mambsys2.nim b/tests/accept/run/mambsys2.nim index 395425b86..395425b86 100644 --- a/tests/mambsys2.nim +++ b/tests/accept/run/mambsys2.nim diff --git a/tests/minit.nim b/tests/accept/run/minit.nim index d3b4b0be1..d3b4b0be1 100644 --- a/tests/minit.nim +++ b/tests/accept/run/minit.nim diff --git a/tests/cairotest.nim b/tests/cairotest.nim deleted file mode 100644 index 2c28e1abf..000000000 --- a/tests/cairotest.nim +++ /dev/null @@ -1,14 +0,0 @@ -import cairo - -var surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 240, 80) -var cr = cairo_create(surface) - -cairo_select_font_face(cr, "serif", CAIRO_FONT_SLANT_NORMAL, - CAIRO_FONT_WEIGHT_BOLD) -cairo_set_font_size(cr, 32.0) -cairo_set_source_rgb(cr, 0.0, 0.0, 1.0) -cairo_move_to(cr, 10.0, 50.0) -cairo_show_text(cr, "Hello, world") -cairo_destroy(cr) -discard cairo_surface_write_to_png(surface, "hello.png") -cairo_surface_destroy(surface) diff --git a/tests/cgitest.nim b/tests/cgitest.nim deleted file mode 100644 index ef115c80b..000000000 --- a/tests/cgitest.nim +++ /dev/null @@ -1,15 +0,0 @@ -# Test the new CGI module -import strtabs, cgi - - -#setTestData("name", "the andreas", "password", "rumpf\t\ttab") - -var myData = readData() -validateData(myData, "name", "password") -writeContentType() - -write(stdout, "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\">\n") -write(stdout, "<html><head><title>Test</title></head><body>\n") -writeln(stdout, "name: " & myData["name"]) -writeln(stdout, "password: " & myData["password"]) -writeln(stdout, "</body></html>") diff --git a/tests/curltest.nim b/tests/curltest.nim deleted file mode 100644 index 7b040c20a..000000000 --- a/tests/curltest.nim +++ /dev/null @@ -1,10 +0,0 @@ -import - libcurl - -var hCurl = curl_easy_init() -if hCurl != nil: - discard curl_easy_setopt(hCurl, CURLOPT_VERBOSE, True) - discard curl_easy_setopt(hCurl, CURLOPT_URL, "http://nimrod.ethexor.com") - discard curl_easy_perform(hCurl) - curl_easy_cleanup(hCurl) - diff --git a/tests/gtk/ex1.nim b/tests/gtk/ex1.nim deleted file mode 100644 index aa3ed2f66..000000000 --- a/tests/gtk/ex1.nim +++ /dev/null @@ -1,14 +0,0 @@ -import - cairo, glib2, gtk2 - -proc destroy(widget: pGtkWidget, data: pgpointer) {.cdecl.} = - gtk_main_quit() - -var - window: pGtkWidget -gtk_nimrod_init() -window = gtk_window_new(GTK_WINDOW_TOPLEVEL) -discard gtk_signal_connect(GTKOBJECT(window), "destroy", - GTK_SIGNAL_FUNC(destroy), nil) -gtk_widget_show(window) -gtk_main() diff --git a/tests/gtk/ex2.nim b/tests/gtk/ex2.nim deleted file mode 100644 index 80ff6f104..000000000 --- a/tests/gtk/ex2.nim +++ /dev/null @@ -1,21 +0,0 @@ - -import - glib2, gtk2 - -proc destroy(widget: pGtkWidget, data: pgpointer){.cdecl.} = - gtk_main_quit() - -var - window: PGtkWidget - button: PGtkWidget - -gtk_nimrod_init() -window = gtk_window_new(GTK_WINDOW_TOPLEVEL) -button = gtk_button_new_with_label("Click me") -gtk_container_set_border_width(GTK_CONTAINER(Window), 5) -gtk_container_add(GTK_Container(window), button) -discard gtk_signal_connect(GTKOBJECT(window), "destroy", - GTK_SIGNAL_FUNC(destroy), nil) -gtk_widget_show(button) -gtk_widget_show(window) -gtk_main() diff --git a/tests/gtk/ex3.nim b/tests/gtk/ex3.nim deleted file mode 100644 index 460b1e4dc..000000000 --- a/tests/gtk/ex3.nim +++ /dev/null @@ -1,39 +0,0 @@ - -import - glib2, gtk2 - -proc newbutton(ALabel: cstring): PGtkWidget = - Result = gtk_button_new_with_label(ALabel) - gtk_widget_show(result) - -proc destroy(widget: pGtkWidget, data: pgpointer){.cdecl.} = - gtk_main_quit() - -var - window, totalbox, hbox, vbox: PgtkWidget - -gtk_nimrod_init() -window = gtk_window_new(GTK_WINDOW_TOPLEVEL) # Box to divide window in 2 halves: -totalbox = gtk_vbox_new(true, 10) -gtk_widget_show(totalbox) # A box for each half of the screen: -hbox = gtk_hbox_new(false, 5) -gtk_widget_show(hbox) -vbox = gtk_vbox_new(true, 5) -gtk_widget_show(vbox) # Put boxes in their halves -gtk_box_pack_start(GTK_BOX(totalbox), hbox, true, true, 0) -gtk_box_pack_start(GTK_BOX(totalbox), vbox, true, true, 0) # Now fill boxes with buttons. - # Horizontal box -gtk_box_pack_start(GTK_BOX(hbox), newbutton("Button 1"), false, false, 0) -gtk_box_pack_start(GTK_BOX(hbox), newbutton("Button 2"), false, false, 0) -gtk_box_pack_start(GTK_BOX(hbox), newbutton("Button 3"), false, false, 0) # - # Vertical box -gtk_box_pack_start(GTK_BOX(vbox), newbutton("Button A"), true, true, 0) -gtk_box_pack_start(GTK_BOX(vbox), newbutton("Button B"), true, true, 0) -gtk_box_pack_start(GTK_BOX(vbox), newbutton("Button C"), true, true, 0) # Put - # totalbox in window -gtk_container_set_border_width(GTK_CONTAINER(Window), 5) -gtk_container_add(GTK_Container(window), totalbox) -discard gtk_signal_connect(GTKOBJECT(window), "destroy", - GTK_SIGNAL_FUNC(destroy), nil) -gtk_widget_show(window) -gtk_main() diff --git a/tests/gtk/ex4.nim b/tests/gtk/ex4.nim deleted file mode 100644 index a387da972..000000000 --- a/tests/gtk/ex4.nim +++ /dev/null @@ -1,31 +0,0 @@ - -import - glib2, gtk2 - -proc newbutton(ALabel: cstring): PGtkWidget = - Result = gtk_button_new_with_label(ALabel) - gtk_widget_show(result) - -proc destroy(widget: pGtkWidget, data: pgpointer){.cdecl.} = - gtk_main_quit() - -var - window, maintable: PgtkWidget - -proc AddToTable(Widget: PGtkWidget, Left, Right, Top, Bottom: guint) = - gtk_table_attach_defaults(GTK_TABLE(MainTable), Widget, Left, right, top, - bottom) - -gtk_nimrod_init() -window = gtk_window_new(GTK_WINDOW_TOPLEVEL) -Maintable = gtk_table_new(6, 6, True) -gtk_widget_show(MainTable) -AddToTable(newbutton("1,1 At 1,1"), 1, 2, 1, 2) -AddToTable(newbutton("2,2 At 3,1"), 3, 5, 1, 3) -AddToTable(newbutton("4,1 At 4,1"), 1, 5, 4, 5) # Put all in window -gtk_container_set_border_width(GTK_CONTAINER(Window), 5) -gtk_container_add(GTK_Container(window), maintable) -discard gtk_signal_connect(GTKOBJECT(window), "destroy", - GTK_SIGNAL_FUNC(destroy), nil) -gtk_widget_show(window) -gtk_main() diff --git a/tests/gtk/ex5.nim b/tests/gtk/ex5.nim deleted file mode 100644 index 3a5b076c6..000000000 --- a/tests/gtk/ex5.nim +++ /dev/null @@ -1,24 +0,0 @@ - -import - glib2, gtk2 - -proc destroy(widget: pGtkWidget, data: pgpointer){.cdecl.} = - gtk_main_quit() - -var - window: PGtkWidget - button: PGtkWidget - -gtk_nimrod_init() -window = gtk_window_new(GTK_WINDOW_TOPLEVEL) -button = gtk_button_new_with_label("Click me") -gtk_container_set_border_width(GTK_CONTAINER(Window), 5) -gtk_container_add(GTK_Container(window), button) -discard gtk_signal_connect(GTKOBJECT(window), "destroy", - GTK_SIGNAL_FUNC(destroy), nil) -discard gtk_signal_connect_object(GTKOBJECT(button), "clicked", - GTK_SIGNAL_FUNC(gtk_widget_destroy), - GTKOBJECT(window)) -gtk_widget_show(button) -gtk_widget_show(window) -gtk_main() diff --git a/tests/gtk/ex6.nim b/tests/gtk/ex6.nim deleted file mode 100644 index 5f18786fe..000000000 --- a/tests/gtk/ex6.nim +++ /dev/null @@ -1,52 +0,0 @@ - -import - glib2, gtk2 - -type - TButtonSignalState = record - Obj: PgtkObject - SignalID: int32 - Disable: bool - - PButtonSignalState = ptr TButtonSignalState - -proc destroy(widget: pGtkWidget, data: pgpointer){.cdecl.} = - gtk_main_quit() - -proc disablesignal(widget: pGtkWidget, data: pgpointer){.cdecl.} = - if PButtonSignalState(Data).Disable: - gtk_signal_handler_block(PButtonSignalState(Data).Obj, SignalID) - else: - gtk_signal_handler_unblock(PButtonSignalState(Data).Obj, SignalID) - PButtonSignalState(Data).disable = not PButtonSignalState(Data).disable - -var - window: PGtkWidget - quitbutton: PGtkWidget - disablebutton: PGTKWidget - windowbox: PGTKWidget - quitsignal: guint - QuitState: TButtonSignalState - -gtk_nimrod_init() -window = gtk_window_new(GTK_WINDOW_TOPLEVEL) -quitbutton = gtk_button_new_with_label("Quit program") -disablebutton = gtk_button_new_with_label("Disable button") -windowbox = gtk_vbox_new(TRUE, 10) -gtk_box_pack_start(GTK_BOX(windowbox), disablebutton, True, false, 0) -gtk_box_pack_start(GTK_BOX(windowbox), quitbutton, True, false, 0) -gtk_container_set_border_width(GTK_CONTAINER(Window), 10) -gtk_container_add(GTK_Container(window), windowbox) -gtk_signal_connect(GTKOBJECT(window), "destroy", - GTK_SIGNAL_FUNC(destroy), nil) -QuitState.Obj = GTKObject(QuitButton) -SignalID = gtk_signal_connect_object(QuitState.Obj, "clicked", GTK_SIGNAL_FUNC( - gtk_widget_destroy), GTKOBJECT(window)) -QuitState.Disable = True -discard gtk_signal_connect(GTKOBJECT(disablebutton), "clicked", - GTK_SIGNAL_FUNC(disablesignal), addr(QuitState)) -gtk_widget_show(quitbutton) -gtk_widget_show(disablebutton) -gtk_widget_show(windowbox) -gtk_widget_show(window) -gtk_main() diff --git a/tests/gtk/ex7.nim b/tests/gtk/ex7.nim deleted file mode 100644 index 53890d1e1..000000000 --- a/tests/gtk/ex7.nim +++ /dev/null @@ -1,43 +0,0 @@ - -import - gdk2, glib2, gtk2 - -proc destroy(widget: pGtkWidget, data: pgpointer){.cdecl.} = - gtk_main_quit() - -const - Inside: cstring = "Mouse is over label" - OutSide: cstring = "Mouse is not over label" - -var - OverLabel: bool - window, box1, box2, stackbox, label1, Label2: PGtkWidget - -proc ChangeLabel(P: PGtkWidget, Event: PGdkEventCrossing, - Data: var bool){.cdecl.} = - if not Data: gtk_label_set_text(GTKLABEL(Label2), Inside) - else: gtk_label_set_text(GTKLABEL(Label2), Outside) - Data = not Data - -gtk_nimrod_init() -window = gtk_window_new(GTK_WINDOW_TOPLEVEL) -stackbox = gtk_vbox_new(TRUE, 10) -box1 = gtk_event_box_new() -label1 = gtk_label_new("Move mouse over label") -gtk_container_add(GTK_CONTAINER(box1), label1) -box2 = gtk_event_box_new() -label2 = gtk_label_new(OutSide) -gtk_container_add(GTK_CONTAINER(box2), label2) -gtk_box_pack_start(GTK_BOX(stackbox), box1, TRUE, TRUE, 0) -gtk_box_pack_start(GTK_BOX(stackbox), box2, TRUE, TRUE, 0) -gtk_container_set_border_width(GTK_CONTAINER(Window), 5) -gtk_container_add(GTK_Container(window), stackbox) -discard gtk_signal_connect(GTKOBJECT(window), "destroy", - GTK_SIGNAL_FUNC(destroy), nil) -overlabel = False -discard gtk_signal_connect(GTKOBJECT(box1), "enter_notify_event", - GTK_SIGNAL_FUNC(ChangeLabel), addr(Overlabel)) -discard gtk_signal_connect(GTKOBJECT(box1), "leave_notify_event", - GTK_SIGNAL_FUNC(ChangeLabel), addr(Overlabel)) -gtk_widget_show_all(window) -gtk_main() diff --git a/tests/gtk/ex8.nim b/tests/gtk/ex8.nim deleted file mode 100644 index acbba2258..000000000 --- a/tests/gtk/ex8.nim +++ /dev/null @@ -1,32 +0,0 @@ - -import - glib2, gtk2 - -proc destroy(widget: pGtkWidget, data: pgpointer){.cdecl.} = - gtk_main_quit() - -var - window, stackbox, label1, Label2: PGtkWidget - labelstyle: pgtkstyle - -gtk_nimrod_init() -window = gtk_window_new(GTK_WINDOW_TOPLEVEL) -stackbox = gtk_vbox_new(TRUE, 10) -label1 = gtk_label_new("Red label text") -labelstyle = gtk_style_copy(gtk_widget_get_style(label1)) -LabelStyle.fg[GTK_STATE_NORMAL].pixel = 0 -LabelStyle.fg[GTK_STATE_NORMAL].red = 0x0000FFFF -LabelStyle.fg[GTK_STATE_NORMAL].blue = 0 -LabelStyle.fg[GTK_STATE_NORMAL].green = 0 -gtk_widget_set_style(label1, labelstyle) # Uncomment this to see the effect of setting the default style. - # - # gtk_widget_set_default_style(labelstyle) -label2 = gtk_label_new("Black label text") -gtk_box_pack_start(GTK_BOX(stackbox), label1, TRUE, TRUE, 0) -gtk_box_pack_start(GTK_BOX(stackbox), label2, TRUE, TRUE, 0) -gtk_container_set_border_width(GTK_CONTAINER(Window), 5) -gtk_container_add(GTK_Container(window), stackbox) -discard gtk_signal_connect(GTKOBJECT(window), "destroy", - GTK_SIGNAL_FUNC(destroy), nil) -gtk_widget_show_all(window) -gtk_main() diff --git a/tests/gtk/ex9.nim b/tests/gtk/ex9.nim deleted file mode 100644 index ce2f73862..000000000 --- a/tests/gtk/ex9.nim +++ /dev/null @@ -1,47 +0,0 @@ - -import - gdk2, glib2, gtk2 - -proc destroy(widget: pGtkWidget, data: pgpointer){.cdecl.} = - gtk_main_quit() - -const - Inside: cstring = "Mouse is over label" - OutSide: cstring = "Mouse is not over label" - -var - window, button1, Button2, Alabel, stackbox: PGtkWidget - buttonstyle: pgtkstyle - OverButton: bool - -proc ChangeLabel(P: PGtkWidget, Event: PGdkEventCrossing, Data: var bool){.cdecl.} = - if Not Data: gtk_label_set_text(GTKLABEL(ALabel), Inside) - else: gtk_label_set_text(GTKLABEL(ALabel), Outside) - Data = Not Data - -gtk_nimrod_init() -window = gtk_window_new(GTK_WINDOW_TOPLEVEL) -stackbox = gtk_vbox_new(TRUE, 10) -button1 = gtk_button_new_with_label("Move mouse over button") -buttonstyle = gtk_style_copy(gtk_widget_get_style(Button1)) -ButtonStyle.bg[GTK_STATE_PRELIGHT].pixel = 0 -ButtonStyle.bg[GTK_STATE_PRELIGHT].red = 0x0000FFFF'i16 -ButtonStyle.bg[GTK_STATE_PRELIGHT].blue = 0'i16 -ButtonStyle.bg[GTK_STATE_PRELIGHT].green = 0'i16 -gtk_widget_set_style(button1, buttonstyle) -button2 = gtk_button_new() -ALabel = gtk_label_new(Outside) -gtk_container_add(GTK_CONTAINER(button2), ALAbel) -gtk_box_pack_start(GTK_BOX(stackbox), button1, TRUE, TRUE, 0) -gtk_box_pack_start(GTK_BOX(stackbox), button2, TRUE, TRUE, 0) -gtk_container_set_border_width(GTK_CONTAINER(Window), 5) -gtk_container_add(GTK_Container(window), stackbox) -discard gtk_signal_connect(GTKOBJECT(window), "destroy", - GTK_SIGNAL_FUNC(destroy), nil) -overbutton = False -discard gtk_signal_connect(GTKOBJECT(button1), "enter_notify_event", - GTK_SIGNAL_FUNC(ChangeLabel), addr(OverButton)) -discard gtk_signal_connect(GTKOBJECT(button1), "leave_notify_event", - GTK_SIGNAL_FUNC(ChangeLabel), addr(OverButton)) -gtk_widget_show_all(window) -gtk_main() diff --git a/tests/hallo.nim b/tests/hallo.nim deleted file mode 100644 index 070633793..000000000 --- a/tests/hallo.nim +++ /dev/null @@ -1,34 +0,0 @@ -# Hallo world program - -echo("Hi! What's your name?") -var name = readLine(stdin) - -if name == "Andreas": - echo("What a nice name!") -elif name == "": - echo("Don't you have a name?") -else: - echo("Your name is not Andreas...") - -for i in 0..name.len-1: - if name[i] == 'm': - echo("hey, there is an *m* in your name!") - -echo("Please give your password: (12345)") -var pw = readLine(stdin) - -while pw != "12345": - echo("Wrong password! Next try: ") - pw = readLine(stdin) - -echo("""Login complete! -What do you want to do? -delete-everything -restart-computer -go-for-a-walk""") - -case readline(stdin) -of "delete-everything", "restart-computer": - echo("permission denied") -of "go-for-a-walk": echo("please yourself") -else: echo("unknown command") diff --git a/tests/mambsym1.nim b/tests/reject/mambsym1.nim index cf8ac5242..cf8ac5242 100644 --- a/tests/mambsym1.nim +++ b/tests/reject/mambsym1.nim diff --git a/tests/mambsym2.nim b/tests/reject/mambsym2.nim index eac8de6ba..eac8de6ba 100644 --- a/tests/mambsym2.nim +++ b/tests/reject/mambsym2.nim diff --git a/tests/mnamspc1.nim b/tests/reject/mnamspc1.nim index da13c5f24..da13c5f24 100644 --- a/tests/mnamspc1.nim +++ b/tests/reject/mnamspc1.nim diff --git a/tests/mnamspc2.nim b/tests/reject/mnamspc2.nim index 84ef8533e..84ef8533e 100644 --- a/tests/mnamspc2.nim +++ b/tests/reject/mnamspc2.nim diff --git a/tests/mopaque.nim b/tests/reject/mopaque.nim index b7c5180fd..b7c5180fd 100644 --- a/tests/mopaque.nim +++ b/tests/reject/mopaque.nim diff --git a/tests/reject/tatomic.nim b/tests/reject/tatomic.nim new file mode 100644 index 000000000..0f1b8125d --- /dev/null +++ b/tests/reject/tatomic.nim @@ -0,0 +1,5 @@ +var + atomic: int + +echo atomic + diff --git a/tests/sdltest.nim b/tests/sdltest.nim deleted file mode 100644 index ae7f1b41e..000000000 --- a/tests/sdltest.nim +++ /dev/null @@ -1,26 +0,0 @@ -# Test the SDL interface: - -import - SDL - -var - screen, greeting: PSDL_Surface - r: TSDL_Rect - -if SDL_Init(SDL_INIT_VIDEO) == 0: - screen = SDL_SetVideoMode(640, 480, 16, SDL_SWSURFACE or SDL_ANYFORMAT) - if screen == nil: - write(stdout, "screen is nil!\n") - else: - greeting = SDL_LoadBmp("backgrnd.bmp") - if greeting == nil: - write(stdout, "greeting is nil!") - r.x = 0'i16 - r.y = 0'i16 - discard SDL_blitSurface(greeting, nil, screen, addr(r)) - discard SDL_flip(screen) - SDL_Delay(3000) -else: - write(stdout, "SDL_Init failed!\n") - -SDL_Quit() diff --git a/tests/csvtest.csv b/tests/testdata/csvtest.csv index 6e7e14103..6e7e14103 100644 --- a/tests/csvtest.csv +++ b/tests/testdata/csvtest.csv diff --git a/tests/data.csv b/tests/testdata/data.csv index ea73f7387..ea73f7387 100644 --- a/tests/data.csv +++ b/tests/testdata/data.csv diff --git a/tests/testdata/doc1.xml b/tests/testdata/doc1.xml new file mode 100644 index 000000000..2895cc32f --- /dev/null +++ b/tests/testdata/doc1.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<root> + <tag> + <test arg="blah" arg2="test"/> + <test2> + bla ah absy hsh + hsh + sjj + </test2> + <test><teh>bla</teh></test> + </tag> +</root> + + diff --git a/tests/jsontest.json b/tests/testdata/jsontest.json index 27b5ba1d1..27b5ba1d1 100644 --- a/tests/jsontest.json +++ b/tests/testdata/jsontest.json diff --git a/tests/wildhtml.html b/tests/testdata/wildhtml.html index dfab7ba95..dfab7ba95 100644 --- a/tests/wildhtml.html +++ b/tests/testdata/wildhtml.html diff --git a/tests/xmltest.html b/tests/testdata/xmltest.html index ca4abc4eb..ca4abc4eb 100644 --- a/tests/xmltest.html +++ b/tests/testdata/xmltest.html diff --git a/tests/wingui.nim b/tests/wingui.nim deleted file mode 100644 index f4941bcc7..000000000 --- a/tests/wingui.nim +++ /dev/null @@ -1,9 +0,0 @@ -# test a Windows GUI application - -import - windows, shellapi, nb30, mmsystem, shfolder - -#proc MessageBox(hWnd: int, lpText, lpCaption: CString, uType: uint): int -# {stdcall, import: "MessageBox", header: "<windows.h>"} - -discard MessageBox(0, "Hallo World!", "Nimrod GUI application", 0) diff --git a/tests/x11test.nim b/tests/x11test.nim deleted file mode 100644 index db51df2e0..000000000 --- a/tests/x11test.nim +++ /dev/null @@ -1,71 +0,0 @@ -import xlib, xutil, x, keysym - -const - WINDOW_WIDTH = 400 - WINDOW_HEIGHT = 300 - -var - width, height: int - display: PDisplay - screen: cint - depth: int - win: TWindow - sizeHints: TXSizeHints - -proc create_window = - width = WINDOW_WIDTH - height = WINDOW_HEIGHT - - display = XOpenDisplay(nil) - if display == nil: - echo("Verbindung zum X-Server fehlgeschlagen") - quit(1) - - screen = XDefaultScreen(display) - depth = XDefaultDepth(display, screen) - var rootwin = XRootWindow(display, screen) - win = XCreateSimpleWindow(display, rootwin, 100, 10, - width, height, 5, - XBlackPixel(display, screen), - XWhitePixel(display, screen)) - size_hints.flags = PSize or PMinSize or PMaxSize - size_hints.min_width = width - size_hints.max_width = width - size_hints.min_height = height - size_hints.max_height = height - discard XSetStandardProperties(display, win, "Simple Window", "window", - 0, nil, 0, addr(size_hints)) - discard XSelectInput(display, win, ButtonPressMask or KeyPressMask or - PointerMotionMask) - discard XMapWindow(display, win) - -proc close_window = - discard XDestroyWindow(display, win) - discard XCloseDisplay(display) - -var - xev: TXEvent - -proc process_event = - var key: TKeySym - case int(xev.theType) - of KeyPress: - key = XLookupKeysym(cast[ptr TXKeyEvent](addr(xev)), 0) - if key != 0: - echo("keyboard event") - of ButtonPressMask, PointerMotionMask: - Echo("Mouse event") - else: nil - -proc eventloop = - discard XFlush(display) - var num_events = int(XPending(display)) - while num_events != 0: - dec(num_events) - discard XNextEvent(display, addr(xev)) - process_event() - -create_window() -while true: - eventloop() -close_window() |