arturo-lang / arturo

Simple, expressive & portable programming language for efficient scripting
http://arturo-lang.io
MIT License
700 stars 32 forks source link

[VM/values/value] add better unit-tests for deep copies #1348

Open github-actions[bot] opened 9 months ago

github-actions[bot] commented 9 months ago

[VM/values/value] add better unit-tests for deep copies right now, in tests/unittests/deepcopies, we're testing integers strings, blocks and dictionaries. The tests could/should cover pretty much every type (nested or not)

https://github.com/arturo-lang/arturo/blob/818d6a565f675c4ee2f9801899bc50f3a2bd3784/src/vm/values/value.nim#L668

            result.d[k] = newStringBlock(v)

# TODO(VM/values/value) add better unit-tests for deep copies
#  right now, in tests/unittests/deepcopies, we're testing integers
#  strings, blocks and dictionaries. The tests could/should cover pretty
#  much every type (nested or not)
#  labels: values, unit-test

# TODO(VM/values/value) create proper constructor overloads for deep-copying
#  `newQuantity(.., copy=true)` would be the example. It should operate statically,
#  at runtime!
#  labels: values, enhancement, cleanup
proc copyValue*(v: Value): Value {.inline.} =
    ## copy given value (deep copy) and return 
    ## the result

c8e36df8458f0ac2e1ba174969d174c9f20e6356

stale[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.