github.com/emcfarlane/larking@v0.0.0-20220605172417-1704b45ee6c3/starlib/starlarkruntimevar/testdata/runtime.star (about)

     1  # Tests of Starlark 'runtimevar' extension.
     2  load("runtimevar.star", "runtimevar")
     3  load("time.star", "time")
     4  
     5  def test_runtimevar(t):
     6      # variable resource is shared, safe for concurrent access.
     7      val = runtimevar.open("constant://?val=hello+world&decoder=string")
     8      print(val)
     9  
    10      t.eq(val.latest().value, "hello world")
    11      t.true(val)
    12      t.lt(val.latest().update_time, time.now())