1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

tests: ensure that const loading is stressed in live_test.v, to prevent -live regressions for more complex examples like bounce.v

This commit is contained in:
Delyan Angelov 2022-11-11 10:45:54 +02:00
parent e9fac05775
commit c1a44efc78
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -3,6 +3,9 @@ module main
import time import time
import os import os
import v.live import v.live
import math
const some_constant = f64(5.5)
fn append_to_file(fname string, s string) { fn append_to_file(fname string, s string) {
mut f := os.open_append(fname) or { mut f := os.open_append(fname) or {
@ -26,6 +29,7 @@ fn myprintln(s string) {
[live] [live]
fn pmessage() string { fn pmessage() string {
_ := some_constant * math.sin(2.0 * math.pi * f64(time.ticks() % 6000) / 6000)
return 'ORIGINAL' return 'ORIGINAL'
} }