Branch: Tag:

2022-03-17

2022-03-17 16:16:11 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Testsuite: Fix some typeof() tests.

Filter the implicitly added zero type from the result types.

870:   test_any([[int|string a;    string s = sprintf("%O", typeof(aggregate(a)));    return (< "array(string) | array(int)", "array(string | int)", "array(int | string)" >)[s];]], 1); - test_any([[return sprintf("%O", typeof(aggregate()));]], "array(zero)"); + test_any([[return sprintf("%O", typeof(aggregate()));]], "array(zero:)");   test_any([[int i; return (< "int", "int | zero", "zero | int" >)    [sprintf("%O", typeof(max(i,0)))];]], 1)   
901:    "int")      test_any([[mapping(object:string)|mapping(string:int) f; -  return sprintf("%O", typeof(f[class{}()])); ]], +  return sprintf("%O", typeof(f[class{}()]) & ~typeof(0)); ]],    "string")      test_any([[mapping(object:string)|mapping(string:int) f;
914:      test_any([[class Foo { protected string `[](mixed y) {return "";} };    object(Foo) foo; -  return sprintf("%O", typeof(foo[0])); ]], +  return sprintf("%O", typeof(foo[0]) & ~typeof(0)); ]],    "string")      test_any([[class Foo { protected array(int) _indices() {return ({0});} };    object(Foo) foo; -  return sprintf("%O", typeof(indices(foo))); ]], +  return sprintf("%O", typeof(indices(foo)) & ~typeof(0)); ]],    "array(int)")      test_any([[class Foo { protected array(string) _values() {return ({""});} };    object(Foo) foo; -  return sprintf("%O", typeof(values(foo))); ]], +  return sprintf("%O", typeof(values(foo)) & ~typeof(0)); ]],    "array(string)")      test_any([[mapping(string:int) foo;