Skip to content

Commit

Permalink
search for culprint
Browse files Browse the repository at this point in the history
  • Loading branch information
planetis-m committed Oct 21, 2024
1 parent b105f25 commit 253f43a
Showing 1 changed file with 1 addition and 71 deletions.
72 changes: 1 addition & 71 deletions 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, std/[os, times, monotimes, syncio, streams, strutils, parseutils, osproc, locks, terminal]
import raylib, rlgl, raymath, rmem, reasings

# ----------------------------------------------------------------------------------------
# Global Variables Definition
Expand Down Expand Up @@ -58,64 +58,6 @@ 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()

proc testStrutils() =
let str = " Hello, World! "
echo "Stripped: ", strip(str)
echo "To lower: ", toLowerAscii(str)

proc testParseutils() =
var value: int
discard parseInt("42", value)
echo "Parsed integer: ", value

proc testOsproc() =
let (output, exitCode) = execCmdEx("echo Hello from subprocess")
echo "Subprocess output: ", output
echo "Exit code: ", exitCode

proc testLocks() =
var lock: Lock
initLock(lock)

withLock(lock):
echo "This is executed in a locked state"

deinitLock(lock)

proc testTerminal() =
styledEcho(fgRed, "This is red text")
styledEcho(fgGreen, bgBlue, "Green text on blue background")

echo "Cursor position: ", getCursorPos()
stdout.setCursorPos(0, 5)
echo "Moved cursor to row 5, column 0"

# ----------------------------------------------------------------------------------------
# Program main entry point
# ----------------------------------------------------------------------------------------
Expand All @@ -134,18 +76,6 @@ proc main =
testDrawText()
testDrawTextWithFont()

# Run additional module tests
testOs()
testTimes()
testMonotimes()
testSyncio()
testStreams()
testStrutils()
testParseutils()
testOsproc()
testLocks()
testTerminal()

# Main game loop
while not windowShouldClose(): # Detect window close button or ESC key
# Update
Expand Down

0 comments on commit 253f43a

Please sign in to comment.