Преглед на файлове

functions example

master
Martin Dørum преди 3 години
родител
ревизия
4c3494ae56
променени са 3 файла, в които са добавени 31 реда и са изтрити 0 реда
  1. 26
    0
      test/examples/functions.l2
  2. 4
    0
      test/examples/functions.l2.expected
  3. 1
    0
      test/src/examples.t.c

+ 26
- 0
test/examples/functions.l2 Целия файл

@@ -0,0 +1,26 @@
func := {
"hello"
}
print func()

str := "Hello World"
func := {
{
str
}
}
print func()()

func := {
{
str = $.0
}
}
func() 10
print str

func := {
retval := "what's up"
{retval}
}
print func()()

+ 4
- 0
test/examples/functions.l2.expected Целия файл

@@ -0,0 +1,4 @@
hello
Hello World
10
what's up

+ 1
- 0
test/src/examples.t.c Целия файл

@@ -127,6 +127,7 @@ describe(exaples) {
test("examples") {
check("namespaces.l2");
check("arrays.l2");
check("functions.l2");
}

if (error_message != NULL) {

Loading…
Отказ
Запис