From c1a44efc784b11f4815cea920b3bf021a1c1ff48 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Fri, 11 Nov 2022 10:45:54 +0200 Subject: [PATCH] tests: ensure that const loading is stressed in live_test.v, to prevent -live regressions for more complex examples like bounce.v --- vlib/v/live/live_test_template.vv | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vlib/v/live/live_test_template.vv b/vlib/v/live/live_test_template.vv index 9630fff4a9..c781ddb7b7 100644 --- a/vlib/v/live/live_test_template.vv +++ b/vlib/v/live/live_test_template.vv @@ -3,6 +3,9 @@ module main import time import os import v.live +import math + +const some_constant = f64(5.5) fn append_to_file(fname string, s string) { mut f := os.open_append(fname) or { @@ -26,6 +29,7 @@ fn myprintln(s string) { [live] fn pmessage() string { + _ := some_constant * math.sin(2.0 * math.pi * f64(time.ticks() % 6000) / 6000) return 'ORIGINAL' }