From 57313235a9f0d1a86dd7614b00e0927ee1e8d687 Mon Sep 17 00:00:00 2001 From: Mattia Giambirtone Date: Sun, 29 May 2022 14:52:47 +0200 Subject: [PATCH] Added tests directory --- .vscode/configurationCache.log | 1 + .vscode/dryrun.log | 5 + .vscode/settings.json | 3 + .vscode/targets.log | 301 +++++++++++++++++++++++++++++++++ closures.pbc | Bin 0 -> 187 bytes tests/closures.pbc | Bin 0 -> 253 bytes tests/closures.pn | 14 ++ tests/dispatch.pn | 16 ++ 8 files changed, 340 insertions(+) create mode 100644 .vscode/configurationCache.log create mode 100644 .vscode/dryrun.log create mode 100644 .vscode/settings.json create mode 100644 .vscode/targets.log create mode 100644 closures.pbc create mode 100644 tests/closures.pbc create mode 100644 tests/closures.pn create mode 100644 tests/dispatch.pn diff --git a/.vscode/configurationCache.log b/.vscode/configurationCache.log new file mode 100644 index 0000000..800fda4 --- /dev/null +++ b/.vscode/configurationCache.log @@ -0,0 +1 @@ +{"buildTargets":["pretty","run"],"launchTargets":[],"customConfigurationProvider":{"workspaceBrowse":{"browsePath":[],"compilerArgs":[]},"fileIndex":[]}} \ No newline at end of file diff --git a/.vscode/dryrun.log b/.vscode/dryrun.log new file mode 100644 index 0000000..582bef5 --- /dev/null +++ b/.vscode/dryrun.log @@ -0,0 +1,5 @@ +make --dry-run --always-make --keep-going --print-directory +make: Entering directory '/home/nocturn9x/Desktop/peon' +nim --hints:off --warnings:off r src/test.nim +make: Leaving directory '/home/nocturn9x/Desktop/peon' + diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..65e1ec0 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "makefile.extensionOutputFolder": "./.vscode" +} \ No newline at end of file diff --git a/.vscode/targets.log b/.vscode/targets.log new file mode 100644 index 0000000..7772976 --- /dev/null +++ b/.vscode/targets.log @@ -0,0 +1,301 @@ +make all --print-data-base --no-builtin-variables --no-builtin-rules --question +make: *** No rule to make target 'all'. Stop. + +# GNU Make 4.3 +# Built for x86_64-pc-linux-gnu +# Copyright (C) 1988-2020 Free Software Foundation, Inc. +# License GPLv3+: GNU GPL version 3 or later +# This is free software: you are free to change and redistribute it. +# There is NO WARRANTY, to the extent permitted by law. + +# Make data base, printed on Fri May 27 13:08:04 2022 + +# Variables + +# environment +GDK_BACKEND = x11 +# environment +LC_ALL = C +# environment +NO_AT_BRIDGE = 1 +# environment +GTK_RC_FILES = /etc/gtk/gtkrc:/home/nocturn9x/.gtkrc:/home/nocturn9x/.config/gtkrc +# environment +VSCODE_IPC_HOOK_EXTHOST = /run/user/1000/vscode-ipc-4a5329a8-4927-4f38-82c8-d475b22ae12f.sock +# environment +LC_NAME = it_IT.UTF-8 +# environment +LC_NUMERIC = it_IT.UTF-8 +# environment +VSCODE_CWD = /home/nocturn9x/Desktop +# environment +LC_ADDRESS = it_IT.UTF-8 +# default +MAKE_COMMAND := make +# automatic +@D = $(patsubst %/,%,$(dir $@)) +# environment +DOTNET_SYSTEM_GLOBALIZATION_INVARIANT = 1 +# environment +VSCODE_HANDLES_UNCAUGHT_ERRORS = true +# default +.VARIABLES := +# environment +PWD = /home/nocturn9x/Desktop/peon +# automatic +%D = $(patsubst %/,%,$(dir $%)) +# environment +MAIL = /var/spool/mail/nocturn9x +# environment +OLDPWD = /home/nocturn9x +# automatic +^D = $(patsubst %/,%,$(dir $^)) +# environment +VSCODE_LOG_STACK = false +# automatic +%F = $(notdir $%) +# environment +VSCODE_CODE_CACHE_PATH = /home/nocturn9x/.config/Code/CachedData/c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5 +# environment +XDG_SESSION_PATH = /org/freedesktop/DisplayManager/Session1 +# environment +LANG = C +# environment +XAUTHORITY = /home/nocturn9x/.Xauthority +# default +.LOADED := +# default +.INCLUDE_DIRS = /usr/include /usr/local/include /usr/include +# makefile +MAKEFLAGS = pqrR +# makefile +CURDIR := /home/nocturn9x/Desktop/peon +# environment +VSCODE_PIPE_LOGGING = true +# environment +APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL = 1 +# automatic +*D = $(patsubst %/,%,$(dir $*)) +# environment +PAM_KWALLET5_LOGIN = /run/user/1000/kwallet5.socket +# environment +MFLAGS = -pqrR +# default +.SHELLFLAGS := -c +# environment +XDG_CONFIG_DIRS = /home/nocturn9x/.config/kdedefaults:/etc/xdg +# automatic ++D = $(patsubst %/,%,$(dir $+)) +# environment +XCURSOR_THEME = macOSBigSur +# environment +XDG_SESSION_DESKTOP = KDE +# makefile (from 'Makefile', line 1) +MAKEFILE_LIST := Makefile +# automatic +@F = $(notdir $@) +# environment +VSCODE_VERBOSE_LOGGING = true +# environment +VSCODE_PID = 2041 +# environment +XDG_SESSION_TYPE = x11 +# automatic +?D = $(patsubst %/,%,$(dir $?)) +# environment +SESSION_MANAGER = local/lappy:@/tmp/.ICE-unix/3575,unix/lappy:/tmp/.ICE-unix/3575 +# automatic +*F = $(notdir $*) +# environment +QT_QPA_PLATFORMTHEME = gtk +# environment +CHROME_DESKTOP = code-url-handler.desktop +# environment +DBUS_SESSION_BUS_ADDRESS = unix:abstract=/tmp/dbus-nvtxImO4Vm,guid=db9feb4ad463771f499c643d628e1555 +# automatic +pTqzJY|U%Tr^wEbHjsX{@l_D@v*yDjXMdhBiwu4kL3&oWrM zel;HxPz@&ogAoIRJCMcCz#z)N01{(m$jr-2En;S1kO1<)0{Nvt`{fxJR8Uk%Gcaf} z0NuyHz`+1k5mKHn09Fsug#cO%43a>zfj}IHCD|CnfRuo`5EFyCBp-t$D@Z?sh6vDZ H4FPokXudO~ literal 0 HcmV?d00001 diff --git a/tests/closures.pn b/tests/closures.pn new file mode 100644 index 0000000..e54ebb5 --- /dev/null +++ b/tests/closures.pn @@ -0,0 +1,14 @@ +fn outer { + var x = 5; + fn inner { + var y = x; + } +} + + +fn outerTwo: fn: int { + fn inner: int { + return 0; + } + return inner; +} diff --git a/tests/dispatch.pn b/tests/dispatch.pn new file mode 100644 index 0000000..0631a8f --- /dev/null +++ b/tests/dispatch.pn @@ -0,0 +1,16 @@ +operator `+`(a: int): int { + return a; +} + +operator `+`(a: int32): int32 { + return a; +} + +fn `+`(a, b: int): int32 { + return 0'i32; # Just to test error messages +} + +var `+`: int = 1; # Can't call a value! + ++1; # Works: defined for int64 ++1'u8; # No implementation for uint8, error!