Update curl_parser_test.dart

This commit is contained in:
Ashita Prasad
2024-11-24 06:13:06 +05:30
parent 85842b294d
commit dc1320e766

View File

@ -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',