mirror of
https://github.com/foss42/apidash.git
synced 2025-08-06 13:51:20 +08:00
Update curl_parser_test.dart
This commit is contained in:
@ -4,12 +4,12 @@ import 'package:curl_parser/src/models/curl.dart';
|
|||||||
import 'package:test/test.dart';
|
import 'package:test/test.dart';
|
||||||
|
|
||||||
const defaultTimeout = Timeout(Duration(seconds: 3));
|
const defaultTimeout = Timeout(Duration(seconds: 3));
|
||||||
final exampleDotComUri = Uri.parse('https://www.example.com/');
|
final exampleDotComUri = Uri.parse('https://api.apidash.dev/');
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
test('parse an easy cURL', () async {
|
test('parse an easy cURL', () async {
|
||||||
expect(
|
expect(
|
||||||
Curl.parse('curl -X GET https://www.example.com/'),
|
Curl.parse('curl -X GET https://api.apidash.dev/'),
|
||||||
Curl(
|
Curl(
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
uri: exampleDotComUri,
|
uri: exampleDotComUri,
|
||||||
@ -19,7 +19,7 @@ void main() {
|
|||||||
|
|
||||||
test('compose an easy cURL', () async {
|
test('compose an easy cURL', () async {
|
||||||
expect(
|
expect(
|
||||||
Curl.parse('curl -X GET https://www.example.com/'),
|
Curl.parse('curl -X GET https://api.apidash.dev/'),
|
||||||
Curl(
|
Curl(
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
uri: exampleDotComUri,
|
uri: exampleDotComUri,
|
||||||
@ -29,7 +29,7 @@ void main() {
|
|||||||
|
|
||||||
test('Check quotes support for URL string', () async {
|
test('Check quotes support for URL string', () async {
|
||||||
expect(
|
expect(
|
||||||
Curl.parse('curl -X GET "https://www.example.com/"'),
|
Curl.parse('curl -X GET "https://api.apidash.dev/"'),
|
||||||
Curl(
|
Curl(
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
uri: exampleDotComUri,
|
uri: exampleDotComUri,
|
||||||
@ -40,7 +40,7 @@ void main() {
|
|||||||
test('parses two headers', () async {
|
test('parses two headers', () async {
|
||||||
expect(
|
expect(
|
||||||
Curl.parse(
|
Curl.parse(
|
||||||
'curl -X GET https://www.example.com/ -H "${HttpHeaders.contentTypeHeader}: ${ContentType.text}" -H "${HttpHeaders.authorizationHeader}: Bearer %token%"',
|
'curl -X GET https://api.apidash.dev/ -H "${HttpHeaders.contentTypeHeader}: ${ContentType.text}" -H "${HttpHeaders.authorizationHeader}: Bearer %token%"',
|
||||||
),
|
),
|
||||||
Curl(
|
Curl(
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
@ -102,7 +102,7 @@ void main() {
|
|||||||
test('tryParse success', () async {
|
test('tryParse success', () async {
|
||||||
expect(
|
expect(
|
||||||
Curl.tryParse(
|
Curl.tryParse(
|
||||||
'curl -X GET https://www.example.com/ -H "${HttpHeaders.contentTypeHeader}: ${ContentType.text}" -H "${HttpHeaders.authorizationHeader}: Bearer %token%"',
|
'curl -X GET https://api.apidash.dev/ -H "${HttpHeaders.contentTypeHeader}: ${ContentType.text}" -H "${HttpHeaders.authorizationHeader}: Bearer %token%"',
|
||||||
),
|
),
|
||||||
Curl(
|
Curl(
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
|
Reference in New Issue
Block a user