Skip to content

co19: Un-optimizable test 'check' function #218

Closed
@DartBot

Description

@DartBot

This issue was originally filed by zundel@google.com


co19/LibTest/core/Queue/Queue.from/Queue/Queue.from/A01/t01
co19/LibTest/core/Queue/Queue.from/Queue/Queue.from/A01/t02

file:/home/zundel/dart/tests/co19/src/LibTest/core/Queue/Queue.from/Queue_Queue.from_A01_t02.dart/Queue_Queue.from_A01_t02.dart:48: List<<dynamic>> has no method named "removeFirst"
    47: c.forEach(void compare(var element) {
    48: Expect.isTrue(l.removeFirst() == element);

void check(List l, Collection c) {
  Expect.isTrue(l.length == c.length);
  c.forEach(void compare(var element) {
    Expect.isTrue(l.removeFirst() == element);
  });
}

removeFirst() is not a method on List or its superclasses, hence the type error. When optimized, the removeFirst() method from the Queue object might be pruned because there are no references in the program to Queue.removeFirst(). I don't think the test needs to be written this way, maybe just change check() to take a Queue instance for the first parameter, or do something other than removeFirst() to test the first element.

@peter, do you think we need a label below to categorize tests in general, maybe co19 tests in particular?

Metadata

Metadata

Assignees

No one assigned

    Labels

    closed-not-plannedClosed as we don't intend to take action on the reported issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions