Skip to content

Passing no values to an allowMultiple Option does not wrap value in List #110

@seaneagan

Description

@seaneagan
      test('passing no values yields default value when defined', () {
        var optionValue;
        return new FunctionScript(({@Option(allowMultiple: true, defaultsTo: 'x') option}) {
          optionValue = option;
        }).execute([]).then((_) {
          expect(optionValue, ['x']);
        });
      });

      test('passing no values yields empty List when default value is null', () {
        var optionValue;
        return new FunctionScript(({@Option(allowMultiple: true) option}) {
          optionValue = option;
        }).execute([]).then((_) {
          expect(optionValue, []);
        });
      });

Both of the above tests currently, because the option is just assigned it's default value (even when it's null).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions