summary refs log tree commit diff stats
path: root/tests/misc/trunner.nim
Commit message (Expand)AuthorAgeFilesLines
* fixes a CI error (#20834)ringabout2022-11-141-1/+1
* fixes #11953; jsondoc creates no files unless the htmldocs dir is created (#2...ringabout2022-08-201-0/+16
* fixes #20149; fixes #16762; hintAsError and warningAsError now ignore foreign...ringabout2022-08-191-0/+6
* closes #15316; add testcase (#20213)ringabout2022-08-131-0/+6
* fixes #20132; fixes the broken jsondoc comand [backport] (#20135)ringabout2022-08-041-0/+17
* fix #8219; nim check/dump shouldn't run single nimscript project [backport: 1...flywind2022-03-261-0/+5
* properly fix #10053 ; `FieldDefect` msg now shows discriminant value + linein...Timothee Cour2021-08-131-3/+13
* followup #18362: make `UnusedImport` work robustly (#18366)Timothee Cour2021-06-271-1/+25
* support `--hint:all:off --hint:x` (ditto with `--warnings` + friends) (#17852)Timothee Cour2021-06-201-6/+3
* merge BuildMode into SuccessX, remove code duplication w drnim, add useful in...Timothee Cour2021-06-141-1/+1
* fixes #18058 (#18162)Andreas Rumpf2021-06-031-2/+2
* remove some custom logic in testament around flags, testExec (#18090)Timothee Cour2021-05-261-3/+30
* testament :show duration also for failed tests; improve `tshould_not_work`; m...Timothee Cour2021-05-081-0/+2
* fix #17853 (ascii message separator broke json nim dump) (#17887)Timothee Cour2021-04-291-0/+11
* Implement https://forum.nim-lang.org/t/7848#50018 (#17874)c-blake2021-04-291-1/+1
* `--usenimcache` (implied by `nim r main`) now caches some compile options to ...Timothee Cour2021-04-251-12/+36
* add `--processing:dots|filenames|off` to customize `hintProcessing` (#17817)Timothee Cour2021-04-231-1/+1
* unit separator (#17730)Andreas Rumpf2021-04-201-2/+2
* fix #17190 `nimscript` now accepts arbitrary file extensions for `nim e main....flywind2021-04-011-0/+9
* remove .github/workflows/ci_ssl.yml; instead run via trunner_thirdparty (#16221)Timothee Cour2021-02-021-5/+2
* Make test independent of repo location (#16571)Clyybber2021-01-031-3/+1
* Revert "Make config processing order test more robust" (#16561)flywind2021-01-031-1/+1
* Make config processing order test more robustClyybber2021-01-021-1/+1
* fix #16526 run config.nims before foo.nim.cfg (#16557)Timothee Cour2021-01-021-0/+19
* fix `hintProcessing` dots interference with `static:echo` and `hintCC`; add t...Timothee Cour2020-12-301-8/+56
* add test for --eval; fix a minor bug (#16224)Timothee Cour2020-12-011-0/+6
* Correct all eggs (#15906)Miran2020-11-101-1/+1
* {.deprecated: [existsFile: fileExists].} (#14735)Timothee Cour2020-07-021-1/+1
* walkDirRecFilter, update doc CI filter, compiler/index.nim for docs + variou...Timothee Cour2020-06-011-5/+2
* docgen: mangling using _. instead of @@ to avoid issue (#14454)Timothee Cour2020-05-261-19/+19
* fix #6583, fix #14376, index+search now generated for all projects, many bug ...Timothee Cour2020-05-251-12/+89
* trunner was not actually being tested in non-CTFFI mode; minor testament clea...Timothee Cour2020-05-191-0/+144
{ color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
discard """
  output: '''11
22
33
3
2
3
3
15
(oa: [1, 3, 4])'''
  targets: "c cpp"
"""

{.experimental: "views".}

proc take(a: openArray[int]) =
  echo a.len

proc main(s: seq[int]) =
  var x: openArray[int] = s
  for i in 0 .. high(x):
    echo x[i]
  take(x)

  take(x.toOpenArray(0, 1))
  let y = x
  take y
  take x

main(@[11, 22, 33])

var x: int

proc foo(x: var int): var int =
  once: x = 42
  return x

var y: var int = foo(x)
y = 15
echo foo(x)
# bug #16132

# bug #18690

type
  F = object
    oa: openArray[int]

let s1 = @[1,3,4,5,6]
var test = F(oa: toOpenArray(s1, 0, 2))
echo test

type
  Foo = object
    x: string
    y: seq[int]
    data: array[10000, byte]

  View[T] = object
    x: lent T

proc mainB =
  let f = Foo(y: @[1, 2, 3])
  let foo = View[Foo](x: f)
  assert foo.x.x == ""
  assert foo.x.y == @[1, 2, 3]

mainB()


# bug #15897
type Outer = ref object 
  value: int
type Inner = object
  owner: var Outer
  
var o = Outer(value: 1234)
var v = Inner(owner: o).owner.value
doAssert v == 1234