mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 17:48:21 +00:00
another set of tweaks per review comments
This commit is contained in:
parent
d4eb0224a1
commit
7904701ffb
5 changed files with 8 additions and 11 deletions
|
@ -2120,8 +2120,7 @@ ExprPtr ArithCoerceExpr::Reduce(Reducer* c, StmtPtr& red_stmt)
|
||||||
|
|
||||||
if ( IsArithmetic(t->Tag()) || IsArithmetic(ct->Tag()) )
|
if ( IsArithmetic(t->Tag()) || IsArithmetic(ct->Tag()) )
|
||||||
{
|
{
|
||||||
auto v = FoldSingleVal(cv, t);
|
if ( auto v = FoldSingleVal(cv, t) )
|
||||||
if ( v )
|
|
||||||
return make_intrusive<ConstExpr>(v);
|
return make_intrusive<ConstExpr>(v);
|
||||||
// else there was a coercion error, fall through
|
// else there was a coercion error, fall through
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
|
||||||
expression error in ./3.zeek, line 5: type-checking failed in vector append (v += ok)
|
|
2
testing/btest/Baseline/language.common-mistakes2/err
Normal file
2
testing/btest/Baseline/language.common-mistakes2/err
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||||
|
expression error in /Users/vern/warehouse/zeek-ZAM-prep3/testing/btest/.tmp/language.common-mistakes2/common-mistakes2.zeek, line 16: type-checking failed in vector append (v += ok)
|
|
@ -1,15 +1,14 @@
|
||||||
# A companion tonguage/common-mistakes.zeek. Split off because we skip this
|
# A companion to language/common-mistakes.zeek. Split off because we skip
|
||||||
# test when using ZAM, since it employs a type-checking violation via
|
# this test when using ZAM, since it employs a type-checking violation via
|
||||||
# vector-of-any, which doesn't seem worth going out of our way to support
|
# vector-of-any, which doesn't seem worth going out of our way to support
|
||||||
# in ZAM (and it isn't dead simple to do so).
|
# in ZAM (and it isn't dead simple to do so).
|
||||||
|
|
||||||
# @TEST-REQUIRES: test "${ZEEK_ZAM}" != "1"
|
# @TEST-REQUIRES: test "${ZEEK_ZAM}" != "1"
|
||||||
|
|
||||||
# @TEST-EXEC: zeek -b 3.zeek >3.out 2>3.err
|
# @TEST-EXEC: zeek -b %INPUT >out 2>err
|
||||||
# @TEST-EXEC: btest-diff 3.out
|
# @TEST-EXEC: btest-diff out
|
||||||
# @TEST-EXEC: btest-diff 3.err
|
# @TEST-EXEC: btest-diff err
|
||||||
|
|
||||||
@TEST-START-FILE 3.zeek
|
|
||||||
function foo(v: vector of any)
|
function foo(v: vector of any)
|
||||||
{
|
{
|
||||||
print "in foo";
|
print "in foo";
|
||||||
|
@ -27,4 +26,3 @@ event zeek_init()
|
||||||
# Unreachable
|
# Unreachable
|
||||||
print "zeek_init done", v;
|
print "zeek_init done", v;
|
||||||
}
|
}
|
||||||
@TEST-END-FILE
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue