Skip to content

Commit

Permalink
add back some
Browse files Browse the repository at this point in the history
  • Loading branch information
planetis-m committed Oct 21, 2024
1 parent 253f43a commit adcef48
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/rmem.nim
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
#
# ****************************************************************************************

when defined(nimPreviewSlimSystem):
import std/assertions

runnableExamples:
# Example 1: MemPool

Expand Down
28 changes: 27 additions & 1 deletion tests/basic_window.nim
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#
# ****************************************************************************************

import raylib, rlgl, raymath, rmem, reasings
import raylib, rlgl, raymath, rmem, reasings, std/[os, times, monotimes, syncio, streams]

# ----------------------------------------------------------------------------------------
# Global Variables Definition
Expand Down Expand Up @@ -58,6 +58,32 @@ proc testDrawTextWithFont() =
let position = Vector2(x: 200, y: 200)
drawText(font, "Hello with custom font", position, 24, 2, DarkGray)

# Additional module tests
proc testOs() =
echo "Current directory: ", getCurrentDir()
echo "Temp directory: ", getTempDir()

proc testTimes() =
echo "Current time: ", now()
echo "Current UTC time: ", utc(now())

proc testMonotimes() =
let start = getMonoTime()
sleep(100)
let duration = getMonoTime() - start
echo "Slept for ", duration

proc testSyncio() =
let file = open("test.txt", fmWrite)
file.write("Hello, SyncIO!")
file.close()

proc testStreams() =
let strm = newFileStream("test_stream.txt", fmWrite)
if not isNil(strm):
strm.writeLine("Hello, Streams!")
strm.close()

# ----------------------------------------------------------------------------------------
# Program main entry point
# ----------------------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions tests/config.nims
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
--path:"../src/"
--define:nimPreviewSlimSystem

0 comments on commit adcef48

Please sign in to comment.