dev-fixtures.sh 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/usr/bin/env bash
  2. # This file contains the text fixtures — the known, constant data — that are
  3. # used when setting up the environment that exa’s tests get run in.
  4. # The directory that all the test files are created under.
  5. export TEST_ROOT=/testcases
  6. # Because the timestamps are formatted differently depending on whether
  7. # they’re in the current year or not (see `details.rs`), we have to make
  8. # sure that the files are created in the current year, so they get shown
  9. # in the format we expect.
  10. export CURRENT_YEAR=$(date "+%Y")
  11. export FIXED_DATE="${CURRENT_YEAR}01011234.56" # 1st January, 12:34:56
  12. # We also need an UID and a GID that are guaranteed to not exist, to
  13. # test what happen when they don’t.
  14. export FIXED_BAD_UID=666
  15. export FIXED_BAD_GID=616
  16. # We create two users that own the test files.
  17. #
  18. # The first one just owns the ordinary ones, because we don’t want the
  19. # test outputs to depend on “vagrant” or “ubuntu” existing.
  20. #
  21. # The second one has a long name, to test that the file owner column
  22. # widens correctly. The benefit of Vagrant is that we don’t need to
  23. # set this up on the *actual* system!
  24. export FIXED_USER="cassowary"
  25. export FIXED_LONG_USER="antidisestablishmentarienism"
  26. # A couple of dates, for date-time testing.
  27. export FIXED_OLD_DATE='200303030000.00'
  28. export FIXED_MED_DATE='200606152314.29' # the june gets used for fr_FR locale tests
  29. export FIXED_NEW_DATE='200912221038.53' # and the december for ja_JP local tests
  30. # Dates that extend beyond 32-bit timespace.
  31. export FIXED_PAST_DATE='170001010000.00'
  32. export FIXED_FUTURE_DATE='230001010000.00'