import 'dart:io';
import 'package:expect/minitest.dart';
import 'package:dev_compiler/src/kernel/command.dart';

main(List<String> args) {
  // Various URL schemes
  expect(stringToUri("dart:io").toString(), "dart:io");
  expect(stringToUri("package:expect/minitest.dart").toString(),
      "package:expect/minitest.dart");
  expect(stringToUri("foobar:whatnot").toString(), "foobar:whatnot");

  // Full Windows path
  expect(stringToUri("C:\\full\\windows\\path.foo", windows: true).toString(),
      "file:///C:/full/windows/path.foo");
  expect(stringToUri("C:/full/windows/path.foo", windows: true).toString(),
      "file:///C:/full/windows/path.foo");

  // Relative Windows path
  expect(
      stringToUri("partial\\windows\\path.foo", windows: true).toString(),
      "file://${Directory.current.path.replaceAll(r'\', r'/')}"
      "/partial/windows/path.foo");

  // Full Unix path
  expect(stringToUri("/full/path/to/foo.bar", windows: false).toString(),
      "file:///full/path/to/foo.bar");

  // Relative Unix path
  expect(
      stringToUri("partial/path/to/foo.bar", windows: false).toString(),
      "file://${Directory.current.path.replaceAll(r'\', r'/')}"
      "/partial/path/to/foo.bar");
}

import 'dart:io';
import 'package:expect/minitest.dart';
import 'package:dev_compiler/src/kernel/command.dart';

main(List<String> args) {
  // Various URL schemes
  expect(stringToUri("dart:io").toString(), "dart:io");
  expect(stringToUri("package:expect/minitest.dart").toString(),
      "package:expect/minitest.dart");
  expect(stringToUri("foobar:whatnot").toString(), "foobar:whatnot");

  // Full Windows path
  expect(stringToUri("C:\\full\\windows\\path.foo", windows: true).toString(),
      "file:///C:/full/windows/path.foo");
  expect(stringToUri("C:/full/windows/path.foo", windows: true).toString(),
      "file:///C:/full/windows/path.foo");

  // Relative Windows path
  expect(stringToUri("partial\\windows\\path.foo", windows: true).toString(),
      "file://${Directory.current.path}/partial/windows/path.foo");

  // Full Unix path
  expect(stringToUri("/full/path/to/foo.bar", windows: false).toString(),
      "file:///full/path/to/foo.bar");

  // Relative Unix path
  expect(stringToUri("partial/path/to/foo.bar", windows: false).toString(),
      "file://${Directory.current.path}/partial/path/to/foo.bar");
}

Revert "Fixup DDC test on Windows"
Revert "Fixup DDC test on Windows"

This reverts commit 70020cd30d9c8d4b42c42b702df2cf2bf6a77d18.

Reason for revert: Didn't quite work.

Original change's description:
> Fixup DDC test on Windows
> 
> Directory.current.path on Windows uses "\" and not "/".
> 
> Bug:
> Change-Id: I6ef789d586622f78d0401c1a892f6a475bf6d93a
> Reviewed-on: https://dart-review.googlesource.com/34100
> Reviewed-by: Jens Johansen <05223a3c6bdf76af6f84755eae231abeebcf4530@google.com>

TBR=dmitryas@google.com,05223a3c6bdf76af6f84755eae231abeebcf4530@google.com

Change-Id: Ied8897801005f1a1b83075c1fb2a0b905129bb18
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/34001
Reviewed-by: Jens Johansen <05223a3c6bdf76af6f84755eae231abeebcf4530@google.com>
Commit-Queue: Jens Johansen <05223a3c6bdf76af6f84755eae231abeebcf4530@google.com>
