Refactor Examples to use assert_eq
This commit updates all example files to use `assert_eq!` for verifying output, replacing the previous `Output:` comments. This change makes the examples more robust and self-testing. The benchmark results in some examples have also been slightly adjusted, reflecting minor performance variations after the refactoring. Additionally, a runtime panic handling mechanism has been introduced in the VM for function calls, which improves error reporting for unexpected panics.
This commit is contained in:
@@ -1,19 +1,17 @@
|
||||
;; Benchmark: 834ns
|
||||
;; Benchmark-Repeat: 2387
|
||||
;; Benchmark: 1.1us
|
||||
;; Benchmark-Repeat: 1783
|
||||
;; Test Record SoA specialization in Pipelines
|
||||
;; Dank der neuen Spezialisierung wird hierfür im Hintergrund
|
||||
;; eine SharedRecordSeries mit SoA-Layout (Float-Puffer für mid und range) erstellt.
|
||||
|
||||
;; Output: <StreamNode>
|
||||
|
||||
(do
|
||||
(def ohlc_stream (create-random-ohlc 42 10))
|
||||
|
||||
;; Pipe die einen Record erzeugt
|
||||
(def indicator
|
||||
(def indicator
|
||||
(pipe [ohlc_stream]
|
||||
(fn [ohlc]
|
||||
{
|
||||
{
|
||||
:mid (/ (+ (.high ohlc) (.low ohlc)) 2.0)
|
||||
:range (- (.high ohlc) (.low ohlc))
|
||||
}
|
||||
@@ -21,5 +19,5 @@
|
||||
)
|
||||
)
|
||||
|
||||
indicator
|
||||
(assert-eq :StreamNode (type-of indicator))
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user