From 41ed70e603c21295f10629aa4ed56983ef20c24d Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Wed, 28 Apr 2021 13:11:13 -0700 Subject: [PATCH] fix tests --- tests/errmsgs/t10734.nim | 8 ++++---- tests/errmsgs/t10735.nim | 20 ++++++++++++++------ tests/errmsgs/t16178_nimcheck_redundant.nim | 14 +++++++------- 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/tests/errmsgs/t10734.nim b/tests/errmsgs/t10734.nim index 4e73db7cd093f..09703de99730b 100644 --- a/tests/errmsgs/t10734.nim +++ b/tests/errmsgs/t10734.nim @@ -1,5 +1,5 @@ discard """ - cmd: "nim check $file" + cmd: "nim check --hints:off $file" errormsg: "" nimout: ''' t10734.nim(19, 1) Error: invalid indentation @@ -7,12 +7,12 @@ t10734.nim(19, 6) Error: invalid indentation t10734.nim(20, 7) Error: expression expected, but found '[EOF]' t10734.nim(18, 5) Error: 'proc' is not a concrete type; for a callback without parameters use 'proc()' t10734.nim(19, 6) Error: undeclared identifier: 'p' -t10734.nim(19, 6) Error: expression 'p' has no type (or is ambiguous) -t10734.nim(19, 6) Error: 'p' cannot be assigned to -t10734.nim(17, 3) Hint: 'T' is declared but not used [XDeclaredButNotUsed] +t10734.nim(19, 6) Error: expression 'error p' has no type (or is ambiguous) +t10734.nim(19, 6) Error: 'error p' cannot be assigned to ''' """ + type T = object a: diff --git a/tests/errmsgs/t10735.nim b/tests/errmsgs/t10735.nim index 307acac2d45bb..bb7396fe8f5fe 100644 --- a/tests/errmsgs/t10735.nim +++ b/tests/errmsgs/t10735.nim @@ -1,10 +1,12 @@ discard """ - cmd: "nim check $file" + cmd: "nim check --hints:off $file" errormsg: "selector must be of an ordinal type, float or string" nimout: ''' -t10735.nim(38, 5) Error: 'let' symbol requires an initialization -t10735.nim(39, 10) Error: undeclared identifier: 'pos' -t10735.nim(39, 9) Error: type mismatch: got +t10735.nim(46, 5) Error: 'let' symbol requires an initialization +t10735.nim(47, 10) Error: undeclared identifier: 'pos' +t10735.nim(47, 10) Error: expression 'error pos' has no type (or is ambiguous) +t10735.nim(47, 10) Error: invalid expression: error pos +t10735.nim(47, 9) Error: type mismatch: got but expected one of: proc `[]`(s: string; i: BackwardsIndex): char first type mismatch at position: 0 @@ -29,12 +31,18 @@ proc `[]`[T](s: var openArray[T]; i: BackwardsIndex): var T template `[]`(s: string; i: int): char first type mismatch at position: 0 -expression: `[]`(buf, pos) -t10735.nim(39, 9) Error: selector must be of an ordinal type, float or string +expression: `[]`(buf, error pos) +t10735.nim(47, 9) Error: selector must be of an ordinal type, float or string ''' joinable: false """ +#[ +PRTEMP: fix: +expression: `[]`(buf, error pos) +]# + +# line 45 let buf: cstring case buf[pos] else: diff --git a/tests/errmsgs/t16178_nimcheck_redundant.nim b/tests/errmsgs/t16178_nimcheck_redundant.nim index 44e52434c81e1..881bb59ab7917 100644 --- a/tests/errmsgs/t16178_nimcheck_redundant.nim +++ b/tests/errmsgs/t16178_nimcheck_redundant.nim @@ -7,21 +7,21 @@ t16178_nimcheck_redundant.nim(32, 11) Error: undeclared identifier: 'bad5' t16178_nimcheck_redundant.nim(36, 11) Error: expression 'error' has no type (or is ambiguous) t16178_nimcheck_redundant.nim(40, 11) Error: expression 'error' has no type (or is ambiguous) t16178_nimcheck_redundant.nim(44, 15) Error: expression 'error' has no type (or is ambiguous) -t16178_nimcheck_redundant.nim(49, 12) Error: undeclared field: 'f1' for type t16178_nimcheck_redundant.A [type declared in t16178_nimcheck_redundant.nim(47, 8)] +t16178_nimcheck_redundant.nim(49, 12) Error: undeclared field: 'f1' for type t16178_nimcheck_redundant.A [type declared in t16178_nimcheck_redundant.nim(47, 8)] t16178_nimcheck_redundant.nim(49, 12) Error: expression 'error' has no type (or is ambiguous) -t16178_nimcheck_redundant.nim(50, 12) Error: undeclared field: 'f2' for type t16178_nimcheck_redundant.A [type declared in t16178_nimcheck_redundant.nim(47, 8)] +t16178_nimcheck_redundant.nim(50, 12) Error: undeclared field: 'f2' for type t16178_nimcheck_redundant.A [type declared in t16178_nimcheck_redundant.nim(47, 8)] t16178_nimcheck_redundant.nim(50, 12) Error: expression 'error' has no type (or is ambiguous) t16178_nimcheck_redundant.nim(51, 8) Error: attempting to call undeclared routine: 'f3=' t16178_nimcheck_redundant.nim(52, 8) Error: attempting to call undeclared routine: 'f4=' ''' """ -#[ -xxx the line `Error: 'let' symbol requires an initialization` is redundant and should not -be reported; likewise with `t16178_nimcheck_redundant.nim(22, 15) Error: expression '' has no type (or is ambiguous)` -TODO: the trailing space `_redundant.nim(47, 8)] ` is bad -]# + + + + +