dart-sdk/tests
Jonas Termansen 96cf889e6b [dart:io] Fix HeaderValue parsing, toString(), and support null values.
This is a breaking change. https://github.com/dart-lang/sdk/issues/40709

This change makes the HeaderValue parsing more strict in two invalid
edge cases, supports parameters with null values as a feature, and fixes
toString() so it always produces tokens or quoted-strings valid per RFC
7230 3.2.6.

The empty parameter value without double quotes (which is not allowed by
the standards) is now parsed as the empty string rather than null. E.g.
HeaderValue.parse("v;a=").parameters now gives {"a": ""} rather than
{"a": null}.

Invalid inputs with unbalanced double quotes are now rejected. E.g.
HeaderValue.parse('v;a="b').parameters will now throw a HttpException
instead of giving {"a": "b"}.

The HeaderValue.toString() method now supports parameters with null
values by omitting the value. E.g.:

  HeaderValue("v", {"a": null, "b": "c"}).toString()

now gives

  v; a; b=c

This behavior can be used to implement some features in the Accept and
Sec-WebSocket-Extensions headers.

Likewise the empty value and values using characters outside of RFC 7230
3.2.6 tokens are now correctly implemented by double quoting such values
with escape sequences. E.g.:

  HeaderValue("v",
      {"a": "A", "b": "(B)", "c": "", "d": "ø", "e": "\\\""}).toString()

now gives

   v;a=A;b="(B)";c="";d="ø";e="\\\""

The NNBD migration required making subtle changes to some dart:io
semantics in order to provide a better API. This change backports one of
these semantic changes to the unmigrated SDK so any issues can be
discovered now instead of blocking the future SDK unfork.

Change-Id: Iafc790e03b6290232cac71fe14f995ce0f0b036b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136620
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-03-18 11:36:36 +00:00
..
angular
co19
co19_2 [nnbd] skip runes tests that are no longer valid 2020-03-03 16:16:21 +00:00
compiler [dart2js] Move a bunch of references from objectType to topType. 2020-03-16 21:54:21 +00:00
corelib Change tests to expect new behavior of fromEnvironment 2020-03-17 13:43:17 +00:00
corelib_2 Change tests to expect new behavior of fromEnvironment 2020-03-17 13:43:17 +00:00
dart
ffi [Cleanup] Removes deprecated --enable-inlining-annotations; updates annotation. 2020-02-25 12:09:10 +00:00
ffi_2 [vm/ffi] Change asFunction and lookFunction to extension methods 2020-02-14 15:46:37 +00:00
kernel [VM] Fixes bad reuse/typing of temps in async transform invocations. 2020-03-06 12:20:45 +00:00
language [tests] Update test expectation methods 2020-03-17 23:43:05 +00:00
language_2 Change tests to expect new behavior of fromEnvironment 2020-03-17 13:43:17 +00:00
lib [tests] Add analysis options file to migrated test directories 2020-03-16 20:51:26 +00:00
lib_2 Adjust test for new default values of .fromEnvironment 2020-03-18 07:55:15 +00:00
modular [CFE] Use package config v2 2020-02-12 10:07:25 +00:00
search
standalone [dart:io] Fix HeaderValue parsing, toString(), and support null values. 2020-03-18 11:36:36 +00:00
standalone_2 [dart:io] Fix HeaderValue parsing, toString(), and support null values. 2020-03-18 11:36:36 +00:00
legacy_status_dart2js.csv Disallow non-external generative JS constructors 2020-03-06 17:06:39 +00:00
README.md

This directory contains tests of the language and core library implementations. For more information, see https://github.com/dart-lang/sdk/wiki/Testing.