Simple email application for Android. Original source code: https://framagit.org/dystopia-project/simple-email
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.7 KiB

  1. // Dependencies
  2. const isSsh = require("../lib")
  3. , tester = require("tester")
  4. ;
  5. // Prepare the input data
  6. var input = [
  7. // Secure Shell Transport Protocol (SSH)
  8. ["ssh://user@host.xz:port/path/to/repo.git/", true]
  9. , ["ssh://user@host.xz/path/to/repo.git/", true]
  10. , ["ssh://host.xz:port/path/to/repo.git/", true]
  11. , ["ssh://host.xz/path/to/repo.git/", true]
  12. , ["ssh://user@host.xz/path/to/repo.git/", true]
  13. , ["ssh://host.xz/path/to/repo.git/", true]
  14. , ["ssh://user@host.xz/~user/path/to/repo.git/", true]
  15. , ["ssh://host.xz/~user/path/to/repo.git/", true]
  16. , ["ssh://user@host.xz/~/path/to/repo.git", true]
  17. , ["ssh://host.xz/~/path/to/repo.git", true]
  18. , ["user@host.xz:/path/to/repo.git/", true]
  19. , ["user@host.xz:~user/path/to/repo.git/", true]
  20. , ["user@host.xz:path/to/repo.git", true]
  21. , ["host.xz:/path/to/repo.git/", true]
  22. , ["host.xz:path/to/repo.git", true]
  23. , ["host.xz:~user/path/to/repo.git/", true]
  24. , ["rsync://host.xz/path/to/repo.git/", true]
  25. // Git Transport Protocol
  26. , ["git://host.xz/path/to/repo.git/", false]
  27. , ["git://host.xz/~user/path/to/repo.git/", false]
  28. // HTTP/S Transport Protocol
  29. , ["http://host.xz/path/to/repo.git/", false]
  30. , ["https://host.xz/path/to/repo.git/", false]
  31. // Local (Filesystem) Transport Protocol
  32. , ["/path/to/repo.git/", false]
  33. , ["path/to/repo.git/", false]
  34. , ["~/path/to/repo.git", false]
  35. , ["file:///path/to/repo.git/", false]
  36. , ["file://~/path/to/repo.git/", false]
  37. ];
  38. tester.describe("check urls", test => {
  39. // Run the tests
  40. input.forEach(c => {
  41. test.it(c[0] + " is supposed " + (!c[1] ? "not " : "") + "to be a ssh url", () => {
  42. test.expect(isSsh(c[0])).toBe(c[1]);
  43. });
  44. });
  45. });