tonyg changed the topic of #racket to: The Racket Programming Language -- https://racket-lang.org/ -- https://gather.town/app/wH1EDG3McffLjrs0/racket-users -- http://pasterack.org -- logged at https://libera.irclog.whitequark.org/racket/ -- This is the right place to ask for help with (Dr)Racket. Remember to wait around for an answer!
Origin has quit [*.net *.split]
wwalker has quit [*.net *.split]
micro has quit [*.net *.split]
micro has joined #racket
wwalker has joined #racket
Tuplanolla has quit [Ping timeout: 246 seconds]
wwalker has quit [Quit: leaving]
wwalker has joined #racket
ec has quit [Remote host closed the connection]
ec has joined #racket
wwalker has quit [Quit: leaving]
wwalker has joined #racket
wwalker has quit [Quit: leaving]
wwalker has joined #racket
Origin has joined #racket
libertyprime has joined #racket
notzmv has quit [Ping timeout: 245 seconds]
wonko-the-sane has joined #racket
wwalker has quit [Quit: leaving]
libertyprime has quit [Quit: leaving]
wwalker has joined #racket
skapata has quit [Remote host closed the connection]
Tuplanolla has joined #racket
to-hu has joined #racket
wonko-th1-sane has joined #racket
wonko-the-sane has quit [Ping timeout: 246 seconds]
dhil has joined #racket
dhil has quit [Ping timeout: 255 seconds]
wonko-th1-sane has quit [Ping timeout: 246 seconds]
wonko-the-sane has joined #racket
to-hu has quit [Remote host closed the connection]
wonko-the-sane has quit [Ping timeout: 246 seconds]
ncf has quit [Ping timeout: 240 seconds]
ncf has joined #racket
skapata has joined #racket
wonko-the-sane has joined #racket
ashpool has joined #racket
<ashpool> I have a very simple s-exp-based DSL implemented in Racket. What's the best way to write a test-suite for it using rackunit? I have customized #%module-begin, and I want to test the values it returns.
<ashpool> I've studied namespaces and sandboxed evaluation for a few days, and I've kind of made it work, but it's very ugly and I have a feeling in must be much much simpler than that.
<ashpool> I would love to look at some code samples for what a test suite might look like, if available.
<ashpool> I'm dynamic-requiring a module, and when I do that, a value is printed to the standard output. How do I get hold of that value in "rade-test.rkt" so I can write tests against it? (dynamic-require) itself returns void.
<bremner> hmm. Can with-output-to-string help?
<bremner> I don't really know anything about dynamic-require.
<ashpool> I could modify the language so that it exports a value, say 'result, and then do (dynamic-require '(submod "rade-test.rkt" zzz) 'result). But what if I don't want to export anything? And what if I need to do the same for a non-s-exp-based language?
wonko-the-sane has quit [Ping timeout: 246 seconds]
<bremner> I basically only use (module+ test ...)
<ashpool> Yeah that's a good idiom but unfortunately my language is so minimalistic it doesn't provide things like (module... ). So I need to write a separate module in racket, make it have a test submodule, and in that submodule dynamically require and test the program in DSL. At least that's how I see it.
wonko-the-sane has joined #racket
dhil has joined #racket
monkey_ has joined #racket
wonko-the-sane has quit [Ping timeout: 246 seconds]
wonko-the-sane has joined #racket
monkey_ has quit [Ping timeout: 255 seconds]
monkey_ has joined #racket
monkey_ has quit [Remote host closed the connection]
dhil has quit [Ping timeout: 245 seconds]
lucasta_ has joined #racket
<dzoe> ashpool: why not plain old require?
<dzoe> (module my-mod racket/base 1)(require 'my-mod) correctly outputs 1 in REPL
<dzoe> I don't see why it should be different for any module. As long as the whole module evaluates to some final value (its last expression).
<dzoe> Ok, for capturing the value, dynamic-require does the trick (for external modules as well).
monkey_ has joined #racket
wonko-the-sane has quit [Ping timeout: 246 seconds]
monkey_ has quit [Ping timeout: 255 seconds]
Origin has quit [Quit: Leaving]
Origin has joined #racket