Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Move Clojure.Source/clojure/test_clojure to Clojure.Tests

  • Loading branch information...
commit 6f9e5b3cefeea8e57fa0db4b6f3628b8ff140d46 1 parent f59049f
@dmiller dmiller authored
Showing with 4,978 additions and 4,976 deletions.
  1. +0 −189 Clojure/Clojure.Source/Clojure.Source.csproj
  2. +191 −0 Clojure/Clojure.Tests/Clojure.Tests.csproj
  3. 0  Clojure/{Clojure.Source → Clojure.Tests}/clojure/run_tests.clj
  4. 0  Clojure/{Clojure.Source → Clojure.Tests}/clojure/run_tests_i.clj
  5. +116 −116 Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/agents.clj
  6. 0  Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/atoms.clj
  7. +112 −112 Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/clojure_set.clj
  8. 0  Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/clojure_walk.clj
  9. 0  Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/clojure_xml.clj
  10. 0  Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/clojure_zip.clj
  11. +166 −166 Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/clr/io.clj
  12. +101 −101 Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/compilation.clj
  13. +305 −305 Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/control.clj
  14. 0  Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/data.clj
  15. +168 −168 Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/data_structures.clj
  16. +38 −38 Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/def.clj
  17. 0  Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/errors.clj
  18. 0  Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/evaluation.clj
  19. +3 −3 Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/for.clj
  20. +133 −133 Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/genclass.clj
  21. +87 −87 Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/genclass/examples.clj
  22. +53 −53 Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/java_interop.clj
  23. 0  Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/keywords.clj
  24. 0  Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/load.clj
  25. 0  Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/load/cyclic0.clj
  26. 0  Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/load/cyclic1.clj
  27. 0  Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/load/cyclic2.clj
  28. 0  Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/load/cyclic3.clj
  29. 0  Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/load/cyclic4.clj
  30. 0  Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/load/cyclic5.clj
  31. 0  Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/load/cyclic6.clj
  32. 0  Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/logic.clj
  33. 0  Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/macros.clj
  34. +52 −52 Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/main.clj
  35. +52 −52 Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/metadata.clj
  36. +137 −137 Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/multimethods.clj
  37. +68 −68 Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/ns_libs.clj
  38. +220 −220 Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/numbers.clj
  39. +233 −233 Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/other_functions.clj
  40. 0  Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/parallel.clj
  41. +19 −19 Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/pprint.clj
  42. +685 −685 Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/pprint/test_cl_format.clj
  43. +31 −31 Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/pprint/test_helper.clj
  44. +317 −317 Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/pprint/test_pretty.clj
  45. 0  Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/predicates.clj
  46. 0  Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/printer.clj
  47. +582 −582 Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/protocols.clj
  48. +12 −12 Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/protocols/examples.clj
  49. 0  Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/protocols/hash_collisions.clj
  50. +7 −7 Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/protocols/more_examples.clj
  51. +66 −66 Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/reader.clj
  52. 0  Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/refs.clj
  53. +31 −31 Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/repl.clj
  54. +5 −5 Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/repl/example.clj
  55. +83 −83 Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/rt.clj
  56. +176 −176 Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/sequences.clj
  57. +161 −161 Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/serialization.clj
  58. 0  Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/special.clj
  59. +118 −118 Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/string.clj
  60. +1 −1  Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/test.clj
  61. +2 −2 Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/test_fixtures.clj
  62. +25 −25 Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/transients.clj
  63. +51 −51 Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/vars.clj
  64. +371 −371 Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_clojure/vectors.clj
  65. 0  Clojure/{Clojure.Source → Clojure.Tests}/clojure/test_helper.clj
View
189 Clojure/Clojure.Source/Clojure.Source.csproj
@@ -102,9 +102,6 @@
<None Include="clojure\reflect\clr.clj">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="clojure\run_tests_i.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
<None Include="clojure\samples\ants.clj">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
@@ -177,153 +174,6 @@
<None Include="clojure\test\tap.clj">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="clojure\run_tests.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\agents.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\atoms.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\clojure_set.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\clojure_walk.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\clojure_xml.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\clojure_zip.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\compilation.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\control.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\data.clj">
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\data_structures.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\errors.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\evaluation.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\for.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\genclass.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\genclass\examples.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\java_interop.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\keywords.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\load.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\load\cyclic3.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\load\cyclic4.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\load\cyclic5.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\load\cyclic6.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\load\cyclic2.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\load\cyclic0.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\load\cyclic1.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\logic.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\macros.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\main.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\metadata.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\multimethods.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\ns_libs.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\numbers.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\other_functions.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\parallel.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\predicates.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\printer.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\protocols.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\protocols\examples.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\protocols\hash_collisions.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\protocols\more_examples.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\reader.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\refs.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\sequences.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\special.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\test.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\test_fixtures.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\vars.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_helper.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
<None Include="clojure\uuid.clj">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
@@ -353,9 +203,6 @@
<None Include="clojure\string.clj">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="clojure\test_clojure\def.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
<None Include="clojure\pprint.clj">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
@@ -383,42 +230,6 @@
<None Include="clojure\samples\stm\teststm.clj">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="clojure\test_clojure\clr\io.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\pprint.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\pprint\test_cl_format.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\pprint\test_helper.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\pprint\test_pretty.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\repl\example.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\repl.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\rt.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\serialization.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\string.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\transients.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="clojure\test_clojure\vectors.clj">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
View
191 Clojure/Clojure.Tests/Clojure.Tests.csproj
@@ -113,6 +113,197 @@
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
+ <ItemGroup>
+ <None Include="clojure\run_tests.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\run_tests_i.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\agents.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\atoms.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\clojure_set.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\clojure_walk.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\clojure_xml.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\clojure_zip.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\clr\io.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\compilation.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\control.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\data.clj">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\data_structures.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\def.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\errors.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\evaluation.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\for.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\genclass.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\genclass\examples.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\java_interop.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\keywords.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\load.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\load\cyclic0.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\load\cyclic1.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\load\cyclic2.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\load\cyclic3.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\load\cyclic4.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\load\cyclic5.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\load\cyclic6.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\logic.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\macros.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\main.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\metadata.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\multimethods.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\ns_libs.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\numbers.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\other_functions.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\parallel.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\pprint.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\pprint\test_cl_format.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\pprint\test_helper.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\pprint\test_pretty.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\predicates.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\printer.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\protocols.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\protocols\examples.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\protocols\hash_collisions.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\protocols\more_examples.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\reader.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\refs.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\repl.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\repl\example.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\rt.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\sequences.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\serialization.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\special.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\string.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\test.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\test_fixtures.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\transients.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\vars.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_clojure\vectors.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="clojure\test_helper.clj">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
View
0  Clojure/Clojure.Source/clojure/run_tests.clj → Clojure/Clojure.Tests/clojure/run_tests.clj
File renamed without changes
View
0  ...re/Clojure.Source/clojure/run_tests_i.clj → ...ure/Clojure.Tests/clojure/run_tests_i.clj
File renamed without changes
View
232 ...re.Source/clojure/test_clojure/agents.clj → ...ure.Tests/clojure/test_clojure/agents.clj
@@ -12,9 +12,9 @@
(:use clojure.test)
(:import [clojure.lang CountDownLatch])) ;;; [java.util.concurrent CountDownLatch TimeUnit]))
-;; tests are fragile. If wait fails, could indicate that
-;; build box is thrashing.
-(def fragile-wait 1000)
+;; tests are fragile. If wait fails, could indicate that
+;; build box is thrashing.
+(def fragile-wait 1000)
(deftest handle-all-throwables-during-agent-actions
;; Bug fixed in r1198; previously hung Clojure or didn't report agent errors
@@ -35,121 +35,121 @@
(is (true? (await-for fragile-wait agt)))
(is (true? @agt))))
-(deftest default-modes
- (is (= :fail (error-mode (agent nil))))
- (is (= :continue (error-mode (agent nil :error-handler println)))))
-
-(deftest continue-handler
- (let [err (atom nil)
- agt (agent 0 :error-mode :continue :error-handler #(reset! err %&))]
- (send agt /)
- (is (true? (await-for fragile-wait agt)))
- (is (= 0 @agt))
- (is (nil? (agent-error agt)))
- (is (= agt (first @err)))
- (is (true? (instance? ArithmeticException (second @err))))))
-
-(deftest fail-handler
- (let [err (atom nil)
- agt (agent 0 :error-mode :fail :error-handler #(reset! err %&))]
- (send agt /)
- (System.Threading.Thread/Sleep 100) ;;; Thread/sleep
- (is (true? (instance? ArithmeticException (agent-error agt))))
- (is (= 0 @agt))
- (is (= agt (first @err)))
- (is (true? (instance? ArithmeticException (second @err))))
- (is (thrown? Exception (send agt inc))))) ;;; RuntimeException
-
-(deftest can-send-from-error-handler-before-popping-action-that-caused-error
- (let [latch (CountDownLatch. 1)
- target-agent (agent :before-error)
- handler (fn [agt err]
- (send target-agent
- (fn [_] (.CountDown latch)))) ;;; .countDown
- failing-agent (agent nil :error-handler handler)]
- (send failing-agent (fn [_] (throw (Exception.)))) ;;; RuntimeException
- (is (.Await latch 10000)))) ;;; 10 TimeUnit/Seconds
-
-#_(deftest can-send-to-self-from-error-handler-before-popping-action-that-caused-error
- (let [latch (CountDownLatch. 1)
- handler (fn [agt err]
- (send *agent*
- (fn [_] (.CountDown latch)))) ;;; .countDown
- failing-agent (agent nil :error-handler handler)]
- (send failing-agent (fn [_] (throw (Exception.)))) ;;; RuntimeException
- (is (.Await latch 10000)))) ;;; .await 10 TimeUnit/Seconds
-
-(deftest restart-no-clear
- (let [p (promise)
- agt (agent 1 :error-mode :fail)]
- (send agt (fn [v] @p))
- (send agt /)
- (send agt inc)
- (send agt inc)
- (deliver p 0)
- (System.Threading.Thread/Sleep 100) ;;; Thread/sleep
- (is (= 0 @agt))
- (is (= ArithmeticException (class (agent-error agt))))
- (restart-agent agt 10)
- (is (true? (await-for fragile-wait agt)))
- (is (= 12 @agt))
- (is (nil? (agent-error agt)))))
-
-(deftest restart-clear
- (let [p (promise)
- agt (agent 1 :error-mode :fail)]
- (send agt (fn [v] @p))
- (send agt /)
- (send agt inc)
- (send agt inc)
- (deliver p 0)
- (System.Threading.Thread/Sleep 100) ;;; Thread/sleep
- (is (= 0 @agt))
- (is (= ArithmeticException (class (agent-error agt))))
- (restart-agent agt 10 :clear-actions true)
- (is (true? (await-for fragile-wait agt)))
- (is (= 10 @agt))
- (is (nil? (agent-error agt)))
- (send agt inc)
- (is (true? (await-for fragile-wait agt)))
- (is (= 11 @agt))
- (is (nil? (agent-error agt)))))
-
-(deftest invalid-restart
- (let [p (promise)
- agt (agent 2 :error-mode :fail :validator even?)]
- (is (thrown? Exception (restart-agent agt 4))) ;;; RuntimeException
- (send agt (fn [v] @p))
- (send agt (partial + 2))
- (send agt (partial + 2))
- (deliver p 3)
- (System.Threading.Thread/Sleep 100) ;;; Thread/sleep
- (is (= 2 @agt))
- (is (= InvalidOperationException (class (agent-error agt)))) ;;; IllegalStateException
- (is (thrown? Exception (restart-agent agt 5))) ;;; RuntimeException
- (restart-agent agt 6)
- (is (true? (await-for fragile-wait agt)))
- (is (= 10 @agt))
+(deftest default-modes
+ (is (= :fail (error-mode (agent nil))))
+ (is (= :continue (error-mode (agent nil :error-handler println)))))
+
+(deftest continue-handler
+ (let [err (atom nil)
+ agt (agent 0 :error-mode :continue :error-handler #(reset! err %&))]
+ (send agt /)
+ (is (true? (await-for fragile-wait agt)))
+ (is (= 0 @agt))
+ (is (nil? (agent-error agt)))
+ (is (= agt (first @err)))
+ (is (true? (instance? ArithmeticException (second @err))))))
+
+(deftest fail-handler
+ (let [err (atom nil)
+ agt (agent 0 :error-mode :fail :error-handler #(reset! err %&))]
+ (send agt /)
+ (System.Threading.Thread/Sleep 100) ;;; Thread/sleep
+ (is (true? (instance? ArithmeticException (agent-error agt))))
+ (is (= 0 @agt))
+ (is (= agt (first @err)))
+ (is (true? (instance? ArithmeticException (second @err))))
+ (is (thrown? Exception (send agt inc))))) ;;; RuntimeException
+
+(deftest can-send-from-error-handler-before-popping-action-that-caused-error
+ (let [latch (CountDownLatch. 1)
+ target-agent (agent :before-error)
+ handler (fn [agt err]
+ (send target-agent
+ (fn [_] (.CountDown latch)))) ;;; .countDown
+ failing-agent (agent nil :error-handler handler)]
+ (send failing-agent (fn [_] (throw (Exception.)))) ;;; RuntimeException
+ (is (.Await latch 10000)))) ;;; 10 TimeUnit/Seconds
+
+#_(deftest can-send-to-self-from-error-handler-before-popping-action-that-caused-error
+ (let [latch (CountDownLatch. 1)
+ handler (fn [agt err]
+ (send *agent*
+ (fn [_] (.CountDown latch)))) ;;; .countDown
+ failing-agent (agent nil :error-handler handler)]
+ (send failing-agent (fn [_] (throw (Exception.)))) ;;; RuntimeException
+ (is (.Await latch 10000)))) ;;; .await 10 TimeUnit/Seconds
+
+(deftest restart-no-clear
+ (let [p (promise)
+ agt (agent 1 :error-mode :fail)]
+ (send agt (fn [v] @p))
+ (send agt /)
+ (send agt inc)
+ (send agt inc)
+ (deliver p 0)
+ (System.Threading.Thread/Sleep 100) ;;; Thread/sleep
+ (is (= 0 @agt))
+ (is (= ArithmeticException (class (agent-error agt))))
+ (restart-agent agt 10)
+ (is (true? (await-for fragile-wait agt)))
+ (is (= 12 @agt))
+ (is (nil? (agent-error agt)))))
+
+(deftest restart-clear
+ (let [p (promise)
+ agt (agent 1 :error-mode :fail)]
+ (send agt (fn [v] @p))
+ (send agt /)
+ (send agt inc)
+ (send agt inc)
+ (deliver p 0)
+ (System.Threading.Thread/Sleep 100) ;;; Thread/sleep
+ (is (= 0 @agt))
+ (is (= ArithmeticException (class (agent-error agt))))
+ (restart-agent agt 10 :clear-actions true)
+ (is (true? (await-for fragile-wait agt)))
+ (is (= 10 @agt))
+ (is (nil? (agent-error agt)))
+ (send agt inc)
+ (is (true? (await-for fragile-wait agt)))
+ (is (= 11 @agt))
+ (is (nil? (agent-error agt)))))
+
+(deftest invalid-restart
+ (let [p (promise)
+ agt (agent 2 :error-mode :fail :validator even?)]
+ (is (thrown? Exception (restart-agent agt 4))) ;;; RuntimeException
+ (send agt (fn [v] @p))
+ (send agt (partial + 2))
+ (send agt (partial + 2))
+ (deliver p 3)
+ (System.Threading.Thread/Sleep 100) ;;; Thread/sleep
+ (is (= 2 @agt))
+ (is (= InvalidOperationException (class (agent-error agt)))) ;;; IllegalStateException
+ (is (thrown? Exception (restart-agent agt 5))) ;;; RuntimeException
+ (restart-agent agt 6)
+ (is (true? (await-for fragile-wait agt)))
+ (is (= 10 @agt))
(is (nil? (agent-error agt)))))
-(deftest earmuff-agent-bound
- (let [a (agent 1)]
- (send a (fn [_] *agent*))
- (await a)
- (is (= a @a))))
-
-(def ^:dynamic *bind-me* :root-binding)
-
-(deftest thread-conveyance-to-agents
- (let [a (agent nil)]
- (doto (System.Threading.Thread.
- (gen-delegate System.Threading.ThreadStart []
- (binding [*bind-me* :thread-binding]
- (send a (constantly *bind-me*)))
- (await a)))
- (.Start)
- (.Join))
- (is (= @a :thread-binding))))
+(deftest earmuff-agent-bound
+ (let [a (agent 1)]
+ (send a (fn [_] *agent*))
+ (await a)
+ (is (= a @a))))
+
+(def ^:dynamic *bind-me* :root-binding)
+
+(deftest thread-conveyance-to-agents
+ (let [a (agent nil)]
+ (doto (System.Threading.Thread.
+ (gen-delegate System.Threading.ThreadStart []
+ (binding [*bind-me* :thread-binding]
+ (send a (constantly *bind-me*)))
+ (await a)))
+ (.Start)
+ (.Join))
+ (is (= @a :thread-binding))))
; http://clojure.org/agents
View
0  ...ure.Source/clojure/test_clojure/atoms.clj → ...jure.Tests/clojure/test_clojure/atoms.clj
File renamed without changes
View
224 ...urce/clojure/test_clojure/clojure_set.clj → ...ests/clojure/test_clojure/clojure_set.clj
@@ -105,118 +105,118 @@
(hash-set 1 2) (hash-set 2 3)
(sorted-set 1 2) (sorted-set 2 3)) #{2} ))
-(deftest test-difference
- (are [x y] (= x y)
- ; identity
- (set/difference #{}) #{}
- (set/difference #{1}) #{1}
- (set/difference #{1 2 3}) #{1 2 3}
-
- ; 2 sets
- (set/difference #{1 2} #{1 2}) #{}
- (set/difference #{1 2} #{3 4}) #{1 2}
- (set/difference #{1 2} #{1}) #{2}
- (set/difference #{1 2} #{2}) #{1}
- (set/difference #{1 2 4} #{2 3 4 5}) #{1}
-
- ; 3 sets
- (set/difference #{1 2} #{2 3} #{5 2}) #{1}
- (set/difference #{1 2 3} #{1 3 4} #{1 3}) #{2}
- (set/difference #{1 2 3} #{3 4 5} #{8 2 3}) #{1} ))
-
-(deftest test-select
- (are [x y] (= x y)
- (set/select integer? #{}) #{}
- (set/select integer? #{1 2}) #{1 2}
- (set/select integer? #{1 2 :a :b :c}) #{1 2}
- (set/select integer? #{:a :b :c}) #{}) )
-
-(def compositions
- #{{:name "Art of the Fugue" :composer "J. S. Bach"}
- {:name "Musical Offering" :composer "J. S. Bach"}
- {:name "Requiem" :composer "Giuseppe Verdi"}
- {:name "Requiem" :composer "W. A. Mozart"}})
-
-(deftest test-project
- (are [x y] (= x y)
- (set/project compositions [:name]) #{{:name "Art of the Fugue"}
- {:name "Requiem"}
- {:name "Musical Offering"}}
- (set/project compositions [:composer]) #{{:composer "W. A. Mozart"}
- {:composer "Giuseppe Verdi"}
- {:composer "J. S. Bach"}}
- (set/project compositions [:year]) #{{}}
- (set/project #{{}} [:name]) #{{}} ))
-
-(deftest test-rename
- (are [x y] (= x y)
- (set/rename compositions {:name :title}) #{{:title "Art of the Fugue" :composer "J. S. Bach"}
- {:title "Musical Offering" :composer "J. S. Bach"}
- {:title "Requiem" :composer "Giuseppe Verdi"}
- {:title "Requiem" :composer "W. A. Mozart"}}
- (set/rename compositions {:year :decade}) #{{:name "Art of the Fugue" :composer "J. S. Bach"}
- {:name "Musical Offering" :composer "J. S. Bach"}
- {:name "Requiem" :composer "Giuseppe Verdi"}
- {:name "Requiem" :composer "W. A. Mozart"}}
- (set/rename #{{}} {:year :decade}) #{{}}))
-
-(deftest test-rename-keys
- (are [x y] (= x y)
- (set/rename-keys {:a "one" :b "two"} {:a :z}) {:z "one" :b "two"}
- ))
-
-(deftest test-index
- (are [x y] (= x y)
- (set/index #{{:c 2} {:b 1} {:a 1 :b 2}} [:b]) {{:b 2} #{{:a 1 :b 2}}, {:b 1} #{{:b 1}} {} #{{:c 2}}}
+(deftest test-difference
+ (are [x y] (= x y)
+ ; identity
+ (set/difference #{}) #{}
+ (set/difference #{1}) #{1}
+ (set/difference #{1 2 3}) #{1 2 3}
+
+ ; 2 sets
+ (set/difference #{1 2} #{1 2}) #{}
+ (set/difference #{1 2} #{3 4}) #{1 2}
+ (set/difference #{1 2} #{1}) #{2}
+ (set/difference #{1 2} #{2}) #{1}
+ (set/difference #{1 2 4} #{2 3 4 5}) #{1}
+
+ ; 3 sets
+ (set/difference #{1 2} #{2 3} #{5 2}) #{1}
+ (set/difference #{1 2 3} #{1 3 4} #{1 3}) #{2}
+ (set/difference #{1 2 3} #{3 4 5} #{8 2 3}) #{1} ))
+
+(deftest test-select
+ (are [x y] (= x y)
+ (set/select integer? #{}) #{}
+ (set/select integer? #{1 2}) #{1 2}
+ (set/select integer? #{1 2 :a :b :c}) #{1 2}
+ (set/select integer? #{:a :b :c}) #{}) )
+
+(def compositions
+ #{{:name "Art of the Fugue" :composer "J. S. Bach"}
+ {:name "Musical Offering" :composer "J. S. Bach"}
+ {:name "Requiem" :composer "Giuseppe Verdi"}
+ {:name "Requiem" :composer "W. A. Mozart"}})
+
+(deftest test-project
+ (are [x y] (= x y)
+ (set/project compositions [:name]) #{{:name "Art of the Fugue"}
+ {:name "Requiem"}
+ {:name "Musical Offering"}}
+ (set/project compositions [:composer]) #{{:composer "W. A. Mozart"}
+ {:composer "Giuseppe Verdi"}
+ {:composer "J. S. Bach"}}
+ (set/project compositions [:year]) #{{}}
+ (set/project #{{}} [:name]) #{{}} ))
+
+(deftest test-rename
+ (are [x y] (= x y)
+ (set/rename compositions {:name :title}) #{{:title "Art of the Fugue" :composer "J. S. Bach"}
+ {:title "Musical Offering" :composer "J. S. Bach"}
+ {:title "Requiem" :composer "Giuseppe Verdi"}
+ {:title "Requiem" :composer "W. A. Mozart"}}
+ (set/rename compositions {:year :decade}) #{{:name "Art of the Fugue" :composer "J. S. Bach"}
+ {:name "Musical Offering" :composer "J. S. Bach"}
+ {:name "Requiem" :composer "Giuseppe Verdi"}
+ {:name "Requiem" :composer "W. A. Mozart"}}
+ (set/rename #{{}} {:year :decade}) #{{}}))
+
+(deftest test-rename-keys
+ (are [x y] (= x y)
+ (set/rename-keys {:a "one" :b "two"} {:a :z}) {:z "one" :b "two"}
+ ))
+
+(deftest test-index
+ (are [x y] (= x y)
+ (set/index #{{:c 2} {:b 1} {:a 1 :b 2}} [:b]) {{:b 2} #{{:a 1 :b 2}}, {:b 1} #{{:b 1}} {} #{{:c 2}}}
))
-(deftest test-join
- (are [x y] (= x y)
- (set/join compositions compositions) compositions
- (set/join compositions #{{:name "Art of the Fugue" :genre "Classical"}})
- #{{:name "Art of the Fugue" :composer "J. S. Bach" :genre "Classical"}}
- ))
-
-(deftest test-map-invert
- (are [x y] (= x y)
- (set/map-invert {:a "one" :b "two"}) {"one" :a "two" :b}))
-
-(deftest test-subset?
- (are [sub super] (set/subset? sub super)
- #{} #{}
- #{} #{1}
- #{1} #{1}
- #{1 2} #{1 2}
- #{1 2} #{1 2 42}
- #{false} #{false}
- #{nil} #{nil}
- #{nil} #{nil false}
- #{1 2 nil} #{1 2 nil 4})
- (are [notsub super] (not (set/subset? notsub super))
- #{1} #{}
- #{2} #{1}
- #{1 3} #{1}
- #{nil} #{false}
- #{false} #{nil}
- #{false nil} #{nil}
- #{1 2 nil} #{1 2}))
-
-(deftest test-superset?
- (are [super sub] (set/superset? super sub)
- #{} #{}
- #{1} #{}
- #{1} #{1}
- #{1 2} #{1 2}
- #{1 2 42} #{1 2}
- #{false} #{false}
- #{nil} #{nil}
- #{false nil} #{false}
- #{1 2 4 nil false} #{1 2 nil})
- (are [notsuper sub] (not (set/superset? notsuper sub))
- #{} #{1}
- #{2} #{1}
- #{1} #{1 3}
- #{nil} #{false}
- #{false} #{nil}
- #{nil} #{false nil}
+(deftest test-join
+ (are [x y] (= x y)
+ (set/join compositions compositions) compositions
+ (set/join compositions #{{:name "Art of the Fugue" :genre "Classical"}})
+ #{{:name "Art of the Fugue" :composer "J. S. Bach" :genre "Classical"}}
+ ))
+
+(deftest test-map-invert
+ (are [x y] (= x y)
+ (set/map-invert {:a "one" :b "two"}) {"one" :a "two" :b}))
+
+(deftest test-subset?
+ (are [sub super] (set/subset? sub super)
+ #{} #{}
+ #{} #{1}
+ #{1} #{1}
+ #{1 2} #{1 2}
+ #{1 2} #{1 2 42}
+ #{false} #{false}
+ #{nil} #{nil}
+ #{nil} #{nil false}
+ #{1 2 nil} #{1 2 nil 4})
+ (are [notsub super] (not (set/subset? notsub super))
+ #{1} #{}
+ #{2} #{1}
+ #{1 3} #{1}
+ #{nil} #{false}
+ #{false} #{nil}
+ #{false nil} #{nil}
+ #{1 2 nil} #{1 2}))
+
+(deftest test-superset?
+ (are [super sub] (set/superset? super sub)
+ #{} #{}
+ #{1} #{}
+ #{1} #{1}
+ #{1 2} #{1 2}
+ #{1 2 42} #{1 2}
+ #{false} #{false}
+ #{nil} #{nil}
+ #{false nil} #{false}
+ #{1 2 4 nil false} #{1 2 nil})
+ (are [notsuper sub] (not (set/superset? notsuper sub))
+ #{} #{1}
+ #{2} #{1}
+ #{1} #{1 3}
+ #{nil} #{false}
+ #{false} #{nil}
+ #{nil} #{false nil}
#{nil 2 3} #{false nil 2 3}))
View
0  ...rce/clojure/test_clojure/clojure_walk.clj → ...sts/clojure/test_clojure/clojure_walk.clj
File renamed without changes
View
0  ...urce/clojure/test_clojure/clojure_xml.clj → ...ests/clojure/test_clojure/clojure_xml.clj
File renamed without changes
View
0  ...urce/clojure/test_clojure/clojure_zip.clj → ...ests/clojure/test_clojure/clojure_zip.clj
File renamed without changes
View
332 ...re.Source/clojure/test_clojure/clr/io.clj → ...ure.Tests/clojure/test_clojure/clr/io.clj
@@ -1,167 +1,167 @@
-; Copyright (c) Rich Hickey. All rights reserved.
-; The use and distribution terms for this software are covered by the
-; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
-; which can be found in the file epl-v10.html at the root of this distribution.
-; By using this software in any fashion, you are agreeing to be bound by
-; the terms of this license.
-; You must not remove this notice, or any other, from this software.
-
-
-
-(ns clojure.test-clojure.clr.io
- (:use clojure.test clojure.clr.io
- [clojure.test-helper :only [platform-newlines]])
- (:import
- (System.IO FileInfo FileMode FileStream StreamReader StreamWriter MemoryStream)
- (System.Text Encoding UTF8Encoding UnicodeEncoding)
- ))
-
-(def utf8 (UTF8Encoding.))
-(def utf16 (UnicodeEncoding.))
-
-(defn temp-file
- [fname]
- (let [fi (FileInfo. fname)]
- (when (.Exists fi)
- (.Delete fi))
- ;(doto (.Create fi) (.Close))
- fi))
-
-
-(defn- get-bytes [^String s ^Encoding encoding]
- (let [cs (.ToCharArray s)
- enc (.GetEncoder encoding)
- cnt (.GetByteCount enc cs 0 (.Length cs) true)
- bs (make-array Byte cnt)]
- (.GetBytes enc cs 0 (.Length cs) bs 0 true)
- bs))
-
-(deftest test-spit-and-slurp
- (let [f (temp-file "text")]
- (spit f "foobar")
- (is (= "foobar" (slurp f)))
- (spit f "foobar" :encoding utf16)
- (is (= "foobar" (slurp f :encoding utf16)))
- (testing "deprecated arity"
- (is (=
- (platform-newlines "WARNING: (slurp f enc) is deprecated, use (slurp f :encoding enc).\n")
- (with-out-str
- (is (= "foobar" (slurp f utf16)))))))))
-
-(deftest test-streams-defaults
- (let [f (temp-file "test-reader-writer")
- content "testing"]
- (try
- (is (thrown? Exception (text-reader (Object.))))
- (is (thrown? Exception (text-writer (Object.))))
-
- (are [write-to read-from] (= content (do
- (spit write-to content :encoding utf8)
- (slurp read-from :encoding utf8)))
- f f
- (.FullName f) (.FullName f)
- (FileStream. (.FullName f) FileMode/Create) (FileStream. (.FullName f) FileMode/Open)
- (StreamWriter. (FileStream. (.FullName f) FileMode/Create) utf8) (text-reader f :encoding utf8)
- f (FileStream. (.FullName f) FileMode/Open)
- (text-writer f :encoding utf8) (StreamReader. (FileStream. (.FullName f) FileMode/Open) utf8))
-
- (is (= content (slurp (get-bytes content utf8))))
- ;(is (= content (slurp (.ToCharArray content))))
- (finally
- (.Delete f)))))
-
-(defn bytes-should-equal [byte-array-1 byte-array-2 msg]
- (is (= |System.Byte[]| (class byte-array-1) (class byte-array-2)) msg)
- (is (= (into [] byte-array-1) (into [] byte-array-2)) msg))
-
-(defn data-fixture
- "in memory fixture data for tests"
- [in-encoding out-encoding]
- (let [bs (get-bytes "hello" in-encoding)
- i (MemoryStream. bs)
- r (StreamReader. i in-encoding)
- o (MemoryStream.)
- w (StreamWriter. o out-encoding )]
- {:bs bs
- :i i
- :r r
- :o o
- :s "hello"
- :w w}))
-
-(deftest test-copy
- (dorun
- (for [{:keys [in out flush] :as test}
- [{:in :i :out :o}
- {:in :i :out :w}
- {:in :r :out :o}
- {:in :r :out :w}
- {:in :bs :out :o}
- {:in :bs :out :w}]
-
- opts
- [{} {:buffer-size 256}]]
- (let [{:keys [s o] :as d} (data-fixture utf8 utf8)]
- (apply copy (in d) (out d) (flatten (vec opts)))
- #_(when (= out :w) (.Flush (:w d)))
- (.Flush (out d))
- (bytes-should-equal (get-bytes s utf8)
- (.ToArray o)
- (str "combination " test opts))))))
-
-(deftest test-copy-encodings
- (testing "from inputstream UTF-16 to writer UTF-8"
- (let [{:keys [i s o w bs]} (data-fixture utf16 utf8)]
- (copy i w :encoding utf16)
- (.Flush w)
- (bytes-should-equal (get-bytes s utf8) (.ToArray o) "")))
- (testing "from reader UTF-8 to output-stream UTF-16"
- (let [{:keys [r o s]} (data-fixture utf8 utf16)]
- (copy r o :encoding utf16)
- (bytes-should-equal (get-bytes s utf16) (.ToArray o) ""))))
-
-;(deftest test-as-file
-; (are [result input] (= result (as-file input))
-; (File. "foo") "foo"
-; (File. "bar") (File. "bar")
-; (File. "baz") (URL. "file:baz")
-; (File. "quux") (URI. "file:quux")
-; nil nil))
-
-;(deftest test-file
-; (are [result args] (= (File. result) (apply file args))
-; "foo" ["foo"]
-; "foo/bar" ["foo" "bar"]
-; "foo/bar/baz" ["foo" "bar" "baz"]))
-;(deftest test-as-url
-; (are [file-part input] (= (URL. (str "file:" file-part)) (as-url input))
-; "foo" "file:foo"
-; "/foo" (File. "/foo")
-; "baz" (URL. "file:baz")
-; "quux" (URI. "file:quux"))
-; (is (nil? (as-url nil))))
-;
-;(deftest test-input-stream
-; (let [file (temp-file "test-input-stream" "txt")
-; bytes (.getBytes "foobar")]
-; (spit file "foobar")
-; (doseq [[expr msg]
-; [[file File]
-; [(FileInputStream. file) FileInputStream]
-; [(BufferedInputStream. (FileInputStream. file)) BufferedInputStream]
-; [(.. file toURI) URI]
-; [(.. file toURI toURL) URL]
-; [(.. file toURI toURL toString) "URL as String"]
-; [(.. file toString) "File as String"]]]
-; (with-open [s (input-stream expr)]
-; (stream-should-have s bytes msg)))))
-
-;(deftest test-socket-iofactory
-; (let [port 65321
-; server-socket (ServerSocket. port)
-; client-socket (Socket. "localhost" port)]
-; (try
-; (is (instance? InputStream (input-stream client-socket)))
-; (is (instance? OutputStream (output-stream client-socket)))
-; (finally (.close server-socket)
+; Copyright (c) Rich Hickey. All rights reserved.
+; The use and distribution terms for this software are covered by the
+; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
+; which can be found in the file epl-v10.html at the root of this distribution.
+; By using this software in any fashion, you are agreeing to be bound by
+; the terms of this license.
+; You must not remove this notice, or any other, from this software.
+
+
+
+(ns clojure.test-clojure.clr.io
+ (:use clojure.test clojure.clr.io
+ [clojure.test-helper :only [platform-newlines]])
+ (:import
+ (System.IO FileInfo FileMode FileStream StreamReader StreamWriter MemoryStream)
+ (System.Text Encoding UTF8Encoding UnicodeEncoding)
+ ))
+
+(def utf8 (UTF8Encoding.))
+(def utf16 (UnicodeEncoding.))
+
+(defn temp-file
+ [fname]
+ (let [fi (FileInfo. fname)]
+ (when (.Exists fi)
+ (.Delete fi))
+ ;(doto (.Create fi) (.Close))
+ fi))
+
+
+(defn- get-bytes [^String s ^Encoding encoding]
+ (let [cs (.ToCharArray s)
+ enc (.GetEncoder encoding)
+ cnt (.GetByteCount enc cs 0 (.Length cs) true)
+ bs (make-array Byte cnt)]
+ (.GetBytes enc cs 0 (.Length cs) bs 0 true)
+ bs))
+
+(deftest test-spit-and-slurp
+ (let [f (temp-file "text")]
+ (spit f "foobar")
+ (is (= "foobar" (slurp f)))
+ (spit f "foobar" :encoding utf16)
+ (is (= "foobar" (slurp f :encoding utf16)))
+ (testing "deprecated arity"
+ (is (=
+ (platform-newlines "WARNING: (slurp f enc) is deprecated, use (slurp f :encoding enc).\n")
+ (with-out-str
+ (is (= "foobar" (slurp f utf16)))))))))
+
+(deftest test-streams-defaults
+ (let [f (temp-file "test-reader-writer")
+ content "testing"]
+ (try
+ (is (thrown? Exception (text-reader (Object.))))
+ (is (thrown? Exception (text-writer (Object.))))
+
+ (are [write-to read-from] (= content (do
+ (spit write-to content :encoding utf8)
+ (slurp read-from :encoding utf8)))
+ f f
+ (.FullName f) (.FullName f)
+ (FileStream. (.FullName f) FileMode/Create) (FileStream. (.FullName f) FileMode/Open)
+ (StreamWriter. (FileStream. (.FullName f) FileMode/Create) utf8) (text-reader f :encoding utf8)
+ f (FileStream. (.FullName f) FileMode/Open)
+ (text-writer f :encoding utf8) (StreamReader. (FileStream. (.FullName f) FileMode/Open) utf8))
+
+ (is (= content (slurp (get-bytes content utf8))))
+ ;(is (= content (slurp (.ToCharArray content))))
+ (finally
+ (.Delete f)))))
+
+(defn bytes-should-equal [byte-array-1 byte-array-2 msg]
+ (is (= |System.Byte[]| (class byte-array-1) (class byte-array-2)) msg)
+ (is (= (into [] byte-array-1) (into [] byte-array-2)) msg))
+
+(defn data-fixture
+ "in memory fixture data for tests"
+ [in-encoding out-encoding]
+ (let [bs (get-bytes "hello" in-encoding)
+ i (MemoryStream. bs)
+ r (StreamReader. i in-encoding)
+ o (MemoryStream.)
+ w (StreamWriter. o out-encoding )]
+ {:bs bs
+ :i i
+ :r r
+ :o o
+ :s "hello"
+ :w w}))
+
+(deftest test-copy
+ (dorun
+ (for [{:keys [in out flush] :as test}
+ [{:in :i :out :o}
+ {:in :i :out :w}
+ {:in :r :out :o}
+ {:in :r :out :w}
+ {:in :bs :out :o}
+ {:in :bs :out :w}]
+
+ opts
+ [{} {:buffer-size 256}]]
+ (let [{:keys [s o] :as d} (data-fixture utf8 utf8)]
+ (apply copy (in d) (out d) (flatten (vec opts)))
+ #_(when (= out :w) (.Flush (:w d)))
+ (.Flush (out d))
+ (bytes-should-equal (get-bytes s utf8)
+ (.ToArray o)
+ (str "combination " test opts))))))
+
+(deftest test-copy-encodings
+ (testing "from inputstream UTF-16 to writer UTF-8"
+ (let [{:keys [i s o w bs]} (data-fixture utf16 utf8)]
+ (copy i w :encoding utf16)
+ (.Flush w)
+ (bytes-should-equal (get-bytes s utf8) (.ToArray o) "")))
+ (testing "from reader UTF-8 to output-stream UTF-16"
+ (let [{:keys [r o s]} (data-fixture utf8 utf16)]
+ (copy r o :encoding utf16)
+ (bytes-should-equal (get-bytes s utf16) (.ToArray o) ""))))
+
+;(deftest test-as-file
+; (are [result input] (= result (as-file input))
+; (File. "foo") "foo"
+; (File. "bar") (File. "bar")
+; (File. "baz") (URL. "file:baz")
+; (File. "quux") (URI. "file:quux")
+; nil nil))
+
+;(deftest test-file
+; (are [result args] (= (File. result) (apply file args))
+; "foo" ["foo"]
+; "foo/bar" ["foo" "bar"]
+; "foo/bar/baz" ["foo" "bar" "baz"]))
+;(deftest test-as-url
+; (are [file-part input] (= (URL. (str "file:" file-part)) (as-url input))
+; "foo" "file:foo"
+; "/foo" (File. "/foo")
+; "baz" (URL. "file:baz")
+; "quux" (URI. "file:quux"))
+; (is (nil? (as-url nil))))
+;
+;(deftest test-input-stream
+; (let [file (temp-file "test-input-stream" "txt")
+; bytes (.getBytes "foobar")]
+; (spit file "foobar")
+; (doseq [[expr msg]
+; [[file File]
+; [(FileInputStream. file) FileInputStream]
+; [(BufferedInputStream. (FileInputStream. file)) BufferedInputStream]
+; [(.. file toURI) URI]
+; [(.. file toURI toURL) URL]
+; [(.. file toURI toURL toString) "URL as String"]
+; [(.. file toString) "File as String"]]]
+; (with-open [s (input-stream expr)]
+; (stream-should-have s bytes msg)))))
+
+;(deftest test-socket-iofactory
+; (let [port 65321
+; server-socket (ServerSocket. port)
+; client-socket (Socket. "localhost" port)]
+; (try
+; (is (instance? InputStream (input-stream client-socket)))
+; (is (instance? OutputStream (output-stream client-socket)))
+; (finally (.close server-socket)
; (.close client-socket)))))
View
202 ...urce/clojure/test_clojure/compilation.clj → ...ests/clojure/test_clojure/compilation.clj
@@ -37,105 +37,105 @@
(:macro m) true
(:name m) 'when )))
-;;;(deftest test-embedded-constants
-;;; (testing "Embedded constants"
-;;; (is (eval `(= Boolean/TYPE ~Boolean/TYPE)))
-;;; (is (eval `(= Byte/TYPE ~Byte/TYPE)))
-;;; (is (eval `(= Character/TYPE ~Character/TYPE)))
-;;; (is (eval `(= Double/TYPE ~Double/TYPE)))
-;;; (is (eval `(= Float/TYPE ~Float/TYPE)))
-;;; (is (eval `(= Integer/TYPE ~Integer/TYPE)))
-;;; (is (eval `(= Long/TYPE ~Long/TYPE)))
-;;; (is (eval `(= Short/TYPE ~Short/TYPE)))))
-
-(deftest test-compiler-resolution
- (testing "resolve nonexistent class create should return nil (assembla #262)"
- (is (nil? (resolve 'NonExistentClass.)))))
-
-(deftest test-no-recur-across-try
- (testing "don't recur to function from inside try"
- (is (thrown? Exception (eval '(fn [x] (try (recur 1)))))))
- (testing "don't recur to loop from inside try"
- (is (thrown? Exception (eval '(loop [x 3] (try (recur 1)))))))
- (testing "don't get confused about what the recur is targeting"
- (is (thrown? Exception (eval '(loop [x 3] (try (fn [x]) (recur 1)))))))
- (testing "don't allow recur accross binding"
- (is (thrown? Exception (eval '(fn [x] (binding [+ *] (recur 1)))))))
- (testing "allow loop/recur inside try"
- (is (try
- (eval '(try (loop [x 3] (if (zero? x) x (recur (dec x))))))
- (catch Exception _))))
- (testing "allow fn/recur inside try"
- (is (try
- (eval '(try
- ((fn [x]
- (if (zero? x)
- x
- (recur (dec x))))
- 3)))
- (catch Exception _)))))
-
-;; disabled until build box can call java from mvn
-#_(deftest test-numeric-dispatch
- (is (= "(int, int)" (TestDispatch/someMethod (int 1) (int 1))))
- (is (= "(int, long)" (TestDispatch/someMethod (int 1) (long 1))))
- (is (= "(long, long)" (TestDispatch/someMethod (long 1) (long 1)))))
-
-(deftest test-CLJ-671-regression
- (testing "that the presence of hints does not cause the compiler to infinitely loop"
- (letfn [(gcd [x y]
- (loop [x (long x) y (long y)]
- (if (== y 0)
- x
- (recur y ^Int64 (rem x y)))))] ;;; ^Long
- (is (= 4 (gcd 8 100))))))
-
-;; ensure proper use of hints / type decls
-
-(defn hinted
- (^String [])
- (^Exception [a]) ;;; ^Integer
- (^System.Collections.IList [a & args])) ;;; ^java.util.List
-
-;; fn names need to be fully-qualified because should-not-reflect evals its arg in a throwaway namespace
-
-(deftest recognize-hinted-arg-vector
- (should-not-reflect #(.Substring (clojure.test-clojure.compilation/hinted) 0)) ;;; .substring
- (should-not-reflect #(.Data (clojure.test-clojure.compilation/hinted "arg"))) ;;; .floatValue
- (should-not-reflect #(.Count (clojure.test-clojure.compilation/hinted :many :rest :args :here)))) ;;; .size
-
-(defn ^String hinting-conflict ^Exception []) ;;; ^Integer
-
-(deftest calls-use-arg-vector-hint
- (should-not-reflect #(.Data (clojure.test-clojure.compilation/hinting-conflict))) ;;; .floatValue
- (should-print-err-message #"(?s)Reflection warning.*"
- #(.Substring (clojure.test-clojure.compilation/hinting-conflict) 0))) ;;; .substring
-
-(deftest deref-uses-var-tag
- (should-not-reflect #(.Substring clojure.test-clojure.compilation/hinting-conflict 0)) ;;; .substring
- (should-print-err-message #"(?s)Reflection warning.*"
- #(.Data clojure.test-clojure.compilation/hinting-conflict))) ;;; .floatValue
-
-(defn ^String legacy-hinting [])
-
-(deftest legacy-call-hint
- (should-not-reflect #(.Substring (clojure.test-clojure.compilation/legacy-hinting) 0))) ;;; .substring
-
-(defprotocol HintedProtocol
- (hintedp ^String [a]
- ^Exception [a b])) ;;; ^Integer
-
-(deftest hinted-protocol-arg-vector
- (should-not-reflect #(.Substring (clojure.test-clojure.compilation/hintedp "") 0)) ;;; .substring
- (should-not-reflect #(.Data (clojure.test-clojure.compilation/hintedp :a :b)))) ;;; .floatValue
-
-(defn primfn
- (^long [])
- (^double [a]))
-
-(deftest primitive-return-decl
- (should-not-reflect #(loop [k 5] (recur (clojure.test-clojure.compilation/primfn))))
- (should-not-reflect #(loop [k 5.0] (recur (clojure.test-clojure.compilation/primfn 0))))
-
- (should-print-err-message #"(?s).*k is not matching primitive.*"
+;;;(deftest test-embedded-constants
+;;; (testing "Embedded constants"
+;;; (is (eval `(= Boolean/TYPE ~Boolean/TYPE)))
+;;; (is (eval `(= Byte/TYPE ~Byte/TYPE)))
+;;; (is (eval `(= Character/TYPE ~Character/TYPE)))
+;;; (is (eval `(= Double/TYPE ~Double/TYPE)))
+;;; (is (eval `(= Float/TYPE ~Float/TYPE)))
+;;; (is (eval `(= Integer/TYPE ~Integer/TYPE)))
+;;; (is (eval `(= Long/TYPE ~Long/TYPE)))
+;;; (is (eval `(= Short/TYPE ~Short/TYPE)))))
+
+(deftest test-compiler-resolution
+ (testing "resolve nonexistent class create should return nil (assembla #262)"
+ (is (nil? (resolve 'NonExistentClass.)))))
+
+(deftest test-no-recur-across-try
+ (testing "don't recur to function from inside try"
+ (is (thrown? Exception (eval '(fn [x] (try (recur 1)))))))
+ (testing "don't recur to loop from inside try"
+ (is (thrown? Exception (eval '(loop [x 3] (try (recur 1)))))))
+ (testing "don't get confused about what the recur is targeting"
+ (is (thrown? Exception (eval '(loop [x 3] (try (fn [x]) (recur 1)))))))
+ (testing "don't allow recur accross binding"
+ (is (thrown? Exception (eval '(fn [x] (binding [+ *] (recur 1)))))))
+ (testing "allow loop/recur inside try"
+ (is (try
+ (eval '(try (loop [x 3] (if (zero? x) x (recur (dec x))))))
+ (catch Exception _))))
+ (testing "allow fn/recur inside try"
+ (is (try
+ (eval '(try
+ ((fn [x]
+ (if (zero? x)
+ x
+ (recur (dec x))))
+ 3)))
+ (catch Exception _)))))
+
+;; disabled until build box can call java from mvn
+#_(deftest test-numeric-dispatch
+ (is (= "(int, int)" (TestDispatch/someMethod (int 1) (int 1))))
+ (is (= "(int, long)" (TestDispatch/someMethod (int 1) (long 1))))
+ (is (= "(long, long)" (TestDispatch/someMethod (long 1) (long 1)))))
+
+(deftest test-CLJ-671-regression
+ (testing "that the presence of hints does not cause the compiler to infinitely loop"
+ (letfn [(gcd [x y]
+ (loop [x (long x) y (long y)]
+ (if (== y 0)
+ x
+ (recur y ^Int64 (rem x y)))))] ;;; ^Long
+ (is (= 4 (gcd 8 100))))))
+
+;; ensure proper use of hints / type decls
+
+(defn hinted
+ (^String [])
+ (^Exception [a]) ;;; ^Integer
+ (^System.Collections.IList [a & args])) ;;; ^java.util.List
+
+;; fn names need to be fully-qualified because should-not-reflect evals its arg in a throwaway namespace
+
+(deftest recognize-hinted-arg-vector
+ (should-not-reflect #(.Substring (clojure.test-clojure.compilation/hinted) 0)) ;;; .substring
+ (should-not-reflect #(.Data (clojure.test-clojure.compilation/hinted "arg"))) ;;; .floatValue
+ (should-not-reflect #(.Count (clojure.test-clojure.compilation/hinted :many :rest :args :here)))) ;;; .size
+
+(defn ^String hinting-conflict ^Exception []) ;;; ^Integer
+
+(deftest calls-use-arg-vector-hint
+ (should-not-reflect #(.Data (clojure.test-clojure.compilation/hinting-conflict))) ;;; .floatValue
+ (should-print-err-message #"(?s)Reflection warning.*"
+ #(.Substring (clojure.test-clojure.compilation/hinting-conflict) 0))) ;;; .substring
+
+(deftest deref-uses-var-tag
+ (should-not-reflect #(.Substring clojure.test-clojure.compilation/hinting-conflict 0)) ;;; .substring
+ (should-print-err-message #"(?s)Reflection warning.*"
+ #(.Data clojure.test-clojure.compilation/hinting-conflict))) ;;; .floatValue
+
+(defn ^String legacy-hinting [])
+
+(deftest legacy-call-hint
+ (should-not-reflect #(.Substring (clojure.test-clojure.compilation/legacy-hinting) 0))) ;;; .substring
+
+(defprotocol HintedProtocol
+ (hintedp ^String [a]
+ ^Exception [a b])) ;;; ^Integer
+
+(deftest hinted-protocol-arg-vector
+ (should-not-reflect #(.Substring (clojure.test-clojure.compilation/hintedp "") 0)) ;;; .substring
+ (should-not-reflect #(.Data (clojure.test-clojure.compilation/hintedp :a :b)))) ;;; .floatValue
+
+(defn primfn
+ (^long [])
+ (^double [a]))
+
+(deftest primitive-return-decl
+ (should-not-reflect #(loop [k 5] (recur (clojure.test-clojure.compilation/primfn))))
+ (should-not-reflect #(loop [k 5.0] (recur (clojure.test-clojure.compilation/primfn 0))))
+
+ (should-print-err-message #"(?s).*k is not matching primitive.*"
#(loop [k (clojure.test-clojure.compilation/primfn)] (recur :foo))))
View
610 ...e.Source/clojure/test_clojure/control.clj → ...re.Tests/clojure/test_clojure/control.clj
@@ -60,96 +60,96 @@
(maintains-identity (fn [_] (do _))) )
-;; loop/recur
-(deftest test-loop
- (are [x y] (= x y)
- 1 (loop []
- 1)
- 3 (loop [a 1]
- (if (< a 3)
- (recur (inc a))
- a))
- [2 4 6] (loop [a []
- b [1 2 3]]
- (if (seq b)
- (recur (conj a (* 2 (first b)))
- (next b))
- a))
- [6 4 2] (loop [a ()
- b [1 2 3]]
- (if (seq b)
- (recur (conj a (* 2 (first b)))
- (next b))
- a))
- )
- )
-
-
-;; throw, try
-
-; if: see logic.clj
-
-(deftest test-when
- (are [x y] (= x y)
- 1 (when true 1)
- nil (when true)
- nil (when false)
- nil (when false (exception))
- ))
-
-(deftest test-when-not
- (are [x y] (= x y)
- 1 (when-not false 1)
- nil (when-not true)
- nil (when-not false)
- nil (when-not true (exception))
- ))
-
-(deftest test-if-not
- (are [x y] (= x y)
- 1 (if-not false 1)
- 1 (if-not false 1 (exception))
- nil (if-not true 1)
- 2 (if-not true 1 2)
- nil (if-not true (exception))
- 1 (if-not true (exception) 1)
- ))
+;; loop/recur
+(deftest test-loop
+ (are [x y] (= x y)
+ 1 (loop []
+ 1)
+ 3 (loop [a 1]
+ (if (< a 3)
+ (recur (inc a))
+ a))
+ [2 4 6] (loop [a []
+ b [1 2 3]]
+ (if (seq b)
+ (recur (conj a (* 2 (first b)))
+ (next b))
+ a))
+ [6 4 2] (loop [a ()
+ b [1 2 3]]
+ (if (seq b)
+ (recur (conj a (* 2 (first b)))
+ (next b))
+ a))
+ )
+ )
+
+
+;; throw, try
+
+; if: see logic.clj
+
+(deftest test-when
+ (are [x y] (= x y)
+ 1 (when true 1)
+ nil (when true)
+ nil (when false)
+ nil (when false (exception))
+ ))
+
+(deftest test-when-not
+ (are [x y] (= x y)
+ 1 (when-not false 1)
+ nil (when-not true)
+ nil (when-not false)
+ nil (when-not true (exception))
+ ))
+
+(deftest test-if-not
+ (are [x y] (= x y)
+ 1 (if-not false 1)
+ 1 (if-not false 1 (exception))
+ nil (if-not true 1)
+ 2 (if-not true 1 2)
+ nil (if-not true (exception))
+ 1 (if-not true (exception) 1)
+ ))
-(deftest test-when-let
- (are [x y] (= x y)
- 1 (when-let [a 1]
- a)
- 2 (when-let [[a b] '(1 2)]
- b)
- nil (when-let [a false]
- (exception))
- ))
-
-(deftest test-if-let
- (are [x y] (= x y)
- 1 (if-let [a 1]
- a)
- 2 (if-let [[a b] '(1 2)]
- b)
- nil (if-let [a false]
- (exception))
- 1 (if-let [a false]
- a 1)
- 1 (if-let [[a b] nil]
- b 1)
- 1 (if-let [a false]
- (exception)
- 1)
- ))
-
-(deftest test-when-first
- (are [x y] (= x y)
- 1 (when-first [a [1 2]]
- a)
- 2 (when-first [[a b] '((1 2) 3)]
- b)
- nil (when-first [a nil]
- (exception))
+(deftest test-when-let
+ (are [x y] (= x y)
+ 1 (when-let [a 1]
+ a)
+ 2 (when-let [[a b] '(1 2)]
+ b)
+ nil (when-let [a false]
+ (exception))
+ ))
+
+(deftest test-if-let
+ (are [x y] (= x y)
+ 1 (if-let [a 1]
+ a)
+ 2 (if-let [[a b] '(1 2)]
+ b)
+ nil (if-let [a false]
+ (exception))
+ 1 (if-let [a false]
+ a 1)
+ 1 (if-let [[a b] nil]
+ b 1)
+ 1 (if-let [a false]
+ (exception)
+ 1)
+ ))
+
+(deftest test-when-first
+ (are [x y] (= x y)
+ 1 (when-first [a [1 2]]
+ a)
+ 2 (when-first [[a b] '((1 2) 3)]
+ b)
+ nil (when-first [a nil]
+ (exception))
))
@@ -193,227 +193,227 @@
(maintains-identity (fn [_] (cond true _))) )
-(deftest test-condp
- (are [x] (= :pass x)
- (condp = 1
- 1 :pass
- 2 :fail)
- (condp = 1
- 2 :fail
- 1 :pass)
- (condp = 1
- 2 :fail
- :pass)
- (condp = 1
- :pass)
- (condp = 1
- 2 :fail
- ;; doc of condp says result-expr is returned
- ;; shouldn't it say similar to cond: "evaluates and returns
- ;; the value of the corresponding expr and doesn't evaluate any of the
- ;; other tests or exprs."
- (identity :pass))
- (condp + 1
- 1 :>> #(if (= % 2) :pass :fail))
- (condp + 1
- 1 :>> #(if (= % 3) :fail :pass))
- )
- (is (thrown? ArgumentException ;;; IllegalArgumentException
- (condp = 1)
- ))
- (is (thrown? ArgumentException ;;; IllegalArgumentException
- (condp = 1
- 2 :fail)
- ))
- )
+(deftest test-condp
+ (are [x] (= :pass x)
+ (condp = 1
+ 1 :pass
+ 2 :fail)
+ (condp = 1
+ 2 :fail
+ 1 :pass)
+ (condp = 1
+ 2 :fail
+ :pass)
+ (condp = 1
+ :pass)
+ (condp = 1
+ 2 :fail
+ ;; doc of condp says result-expr is returned
+ ;; shouldn't it say similar to cond: "evaluates and returns
+ ;; the value of the corresponding expr and doesn't evaluate any of the
+ ;; other tests or exprs."
+ (identity :pass))
+ (condp + 1
+ 1 :>> #(if (= % 2) :pass :fail))
+ (condp + 1
+ 1 :>> #(if (= % 3) :fail :pass))
+ )
+ (is (thrown? ArgumentException ;;; IllegalArgumentException
+ (condp = 1)
+ ))
+ (is (thrown? ArgumentException ;;; IllegalArgumentException
+ (condp = 1
+ 2 :fail)
+ ))
+ )
; [for, doseq (for.clj)]
-(deftest test-dotimes
- ;; dotimes always returns nil
- (is (= nil (dotimes [n 1] n)))
- ;; test using an atom since dotimes is for modifying
- ;; test executes n times
- (is (= 3
- (let [a (atom 0)]
- (dotimes [n 3]
- (swap! a inc))
- @a)
- ))
- ;; test all values of n
- (is (= [0 1 2]
- (let [a (atom [])]
- (dotimes [n 3]
- (swap! a conj n))
- @a)))
- (is (= []
- (let [a (atom [])]
- (dotimes [n 0]
- (swap! a conj n))
- @a)))
- )
-
-(deftest test-while
- (is (= nil (while nil (throw (Exception. "never")))))
- (is (= [0 nil]
- ;; a will dec to 0
- ;; while always returns nil
- (let [a (atom 3)
- w (while (pos? @a)
- (swap! a dec))]
- [@a w])))
- (is (thrown? Exception (while true (throw (Exception. "expected to throw")))))
+(deftest test-dotimes
+ ;; dotimes always returns nil
+ (is (= nil (dotimes [n 1] n)))
+ ;; test using an atom since dotimes is for modifying
+ ;; test executes n times
+ (is (= 3
+ (let [a (atom 0)]
+ (dotimes [n 3]
+ (swap! a inc))
+ @a)
+ ))
+ ;; test all values of n
+ (is (= [0 1 2]
+ (let [a (atom [])]
+ (dotimes [n 3]
+ (swap! a conj n))
+ @a)))
+ (is (= []
+ (let [a (atom [])]
+ (dotimes [n 0]
+ (swap! a conj n))
+ @a)))
+ )
+
+(deftest test-while
+ (is (= nil (while nil (throw (Exception. "never")))))
+ (is (= [0 nil]
+ ;; a will dec to 0
+ ;; while always returns nil
+ (let [a (atom 3)
+ w (while (pos? @a)
+ (swap! a dec))]
+ [@a w])))
+ (is (thrown? Exception (while true (throw (Exception. "expected to throw")))))
)
; locking, monitor-enter, monitor-exit
-; case
-(deftest test-case
- (testing "can match many kinds of things"
- (let [two 2
- test-fn
- #(case %
- 1 :number
- "foo" :string
- \a :char
- pow :symbol
- :zap :keyword
- (2 \b "bar") :one-of-many
- [1 2] :sequential-thing
- {:a 2} :map
- {:r 2 :d 2} :droid
- #{2 3 4 5} :set
- [1 [[[2]]]] :deeply-nested
- nil :nil
- :default)]
- (are [result input] (= result (test-fn input))
- :number 1
- :string "foo"
- :char \a
- :keyword :zap
- :symbol 'pow
- :one-of-many 2
- :one-of-many \b
- :one-of-many "bar"
- :sequential-thing [1 2]
- :sequential-thing (list 1 2)
- :sequential-thing [1 two]
- :map {:a 2}
- :map {:a two}
- :set #{2 3 4 5}
- :set #{two 3 4 5}
- :default #{2 3 4 5 6}
- :droid {:r 2 :d 2}
- :deeply-nested [1 [[[two]]]]
- :nil nil
- :default :anything-not-appearing-above)))
- (testing "throws IllegalArgumentException if no match"
- (is (thrown-with-msg?
- ArgumentException #"No matching clause: 2" ;;; IllegalArgumentException
- (case 2 1 :ok))))
- (testing "sorting doesn't matter"
- (let [test-fn
- #(case %
- {:b 2 :a 1} :map
- #{3 2 1} :set
- :default)]
- (are [result input] (= result (test-fn input))
- :map {:a 1 :b 2}
- :map (sorted-map :a 1 :b 2)
- :set #{3 2 1}
- :set (sorted-set 2 1 3))))
- (testing "test number equivalence"
- (is (= :1 (case 1N 1 :1 :else))))
- (testing "test warn when boxing/hashing expr for all-ints case"
- (should-print-err-message
- #"Performance warning, .*:\d+ - case has int tests, but tested expression is not primitive..*\r?\n"
- (let [x (Object.)] (case x 1 1 2))))
- (testing "test correct behavior on sparse ints"
- (are [result input] (= result (case input
- 2r1000000000000000000000000000000 :big
- 1 :small
- :else))
- :small 1
- :big 1073741824
- :else 2)
- (are [result input] (= result (case input
- 1 :small
- 2r1000000000000000000000000000000 :big
- :else))
- :small 1
- :big 1073741824
- :else 2))
- ;(testing "test emits return types" ;;; TODO: Find another type (ctor or method) (Long doesn't work) to test reflection
- ; (should-not-reflect (Long. (case 1 1 1))) ; new Long(long)
- ; (should-not-reflect (Long. (case 1 1 "1")))) ; new Long(String)
- (testing "non-equivalence of chars and nums"
- (are [result input] (= result (case input 97 :97 :else))
- :else \a
- :else (char \a)
- :97 (int \a))
- (are [result input] (= result (case input \a :a :else))
- :else 97
- :else 97N
- :a (char 97)))
- (testing "test error on duplicate test constants"
- (is (thrown-with-msg?
- ArgumentException ;;; IllegalArgumentException
- #"Duplicate case test constant: 1"
- (eval `(case 0 1 :x 1 :y)))))
- ;(testing "test correct behaviour on Number truncation" ;;; TODO: Figure out the equivalent for us
- ; (let [^Object x (Long. 8589934591) ; force bindings to not be emitted as a primitive long
- ; ^Object y (Long. -1)]
- ; (is (= :diff (case x -1 :oops :diff)))
- ; (is (= :same (case y -1 :same :oops)))))
- (testing "test correct behavior on hash collision"
- (is (== (hash 1) (hash 9223372039002259457N)))
- (are [result input] (= result (case input
- 1 :long
- 9223372039002259457N :big
- :else))
- :long 1
- :big 9223372039002259457N
- :else 4294967296
- :else 2)
- (are [result input] (= result (case input
- 9223372039002259457N :big
- 1 :long
- :else))
- :long 1
- :big 9223372039002259457N
- :else 4294967296
- :else 2)
- (are [result input] (= result (case input
- 0 :zero
- -1 :neg1
- 2 :two
- :oops :OOPS))
- :zero 0
- :neg1 -1
- :two 2
- :OOPS :oops)
- (are [result input] (= result (case input
- 1204766517646190306 :a
- 1 :b
- -2 :c
- :d))
- :a 1204766517646190306
- :b 1
- :c -2
- :d 4294967296
- :d 3))
- (testing "test warn for hash collision"
- (should-print-err-message
- #"Performance warning, .*:\d+ - hash collision of some case test constants; if selected, those entries will be tested sequentially..*\r?\n"
- (case 1 1 :long 9223372039002259457N :big 2)))
- (testing "test constants are *not* evaluated"
- (let [test-fn
- ;; never write code like this...
- #(case %
- (throw (Exception. "boom")) :piece-of-throw-expr ;;; RuntimeException
- :no-match)]
- (are [result input] (= result (test-fn input))
- :piece-of-throw-expr 'throw
- :piece-of-throw-expr '[Exception. "boom"] ;;; RuntimeException
- :no-match nil))))
+; case
+(deftest test-case
+ (testing "can match many kinds of things"
+ (let [two 2
+ test-fn
+ #(case %
+ 1 :number
+ "foo" :string
+ \a :char
+ pow :symbol
+ :zap :keyword
+ (2 \b "bar") :one-of-many
+ [1 2] :sequential-thing
+ {:a 2} :map
+ {:r 2 :d 2} :droid
+ #{2 3 4 5} :set
+ [1 [[[2]]]] :deeply-nested
+ nil :nil
+ :default)]
+ (are [result input] (= result (test-fn input))
+ :number 1
+ :string "foo"
+ :char \a
+ :keyword :zap
+ :symbol 'pow
+ :one-of-many 2
+ :one-of-many \b
+ :one-of-many "bar"
+ :sequential-thing [1 2]
+ :sequential-thing (list 1 2)
+ :sequential-thing [1 two]
+ :map {:a 2}
+ :map {:a two}
+ :set #{2 3 4 5}
+ :set #{two 3 4 5}
+ :default #{2 3 4 5 6}
+ :droid {:r 2 :d 2}
+ :deeply-nested [1 [[[two]]]]
+ :nil nil
+ :default :anything-not-appearing-above)))
+ (testing "throws IllegalArgumentException if no match"
+ (is (thrown-with-msg?
+ ArgumentException #"No matching clause: 2" ;;; IllegalArgumentException
+ (case 2 1 :ok))))
+ (testing "sorting doesn't matter"
+ (let [test-fn
+ #(case %
+ {:b 2 :a 1} :map
+ #{3 2 1} :set
+ :default)]
+ (are [result input] (= result (test-fn input))
+ :map {:a 1 :b 2}
+ :map (sorted-map :a 1 :b 2)
+ :set #{3 2 1}
+ :set (sorted-set 2 1 3))))
+ (testing "test number equivalence"
+ (is (= :1 (case 1N 1 :1 :else))))
+ (testing "test warn when boxing/hashing expr for all-ints case"
+ (should-print-err-message
+ #"Performance warning, .*:\d+ - case has int tests, but tested expression is not primitive..*\r?\n"
+ (let [x (Object.)] (case x 1 1 2))))
+ (testing "test correct behavior on sparse ints"
+ (are [result input] (= result (case input
+ 2r1000000000000000000000000000000 :big
+ 1 :small
+ :else))
+ :small 1
+ :big 1073741824
+ :else 2)
+ (are [result input] (= result (case input
+ 1 :small
+ 2r1000000000000000000000000000000 :big
+ :else))
+ :small 1
+ :big 1073741824
+ :else 2))
+ ;(testing "test emits return types" ;;; TODO: Find another type (ctor or method) (Long doesn't work) to test reflection
+ ; (should-not-reflect (Long. (case 1 1 1))) ; new Long(long)
+ ; (should-not-reflect (Long. (case 1 1 "1")))) ; new Long(String)
+ (testing "non-equivalence of chars and nums"
+ (are [result input] (= result (case input 97 :97 :else))
+ :else \a
+ :else (char \a)
+ :97 (int \a))
+ (are [result input] (= result (case input \a :a :else))
+ :else 97
+ :else 97N
+ :a (char 97)))
+ (testing "test error on duplicate test constants"
+ (is (thrown-with-msg?
+ ArgumentException ;;; IllegalArgumentException
+ #"Duplicate case test constant: 1"
+ (eval `(case 0 1 :x 1 :y)))))
+ ;(testing "test correct behaviour on Number truncation" ;;; TODO: Figure out the equivalent for us
+ ; (let [^Object x (Long. 8589934591) ; force bindings to not be emitted as a primitive long
+ ; ^Object y (Long. -1)]
+ ; (is (= :diff (case x -1 :oops :diff)))
+ ; (is (= :same (case y -1 :same :oops)))))
+ (testing "test correct behavior on hash collision"
+ (is (== (hash 1) (hash 9223372039002259457N)))
+ (are [result input] (= result (case input
+ 1 :long
+ 9223372039002259457N :big
+ :else))
+ :long 1
+ :big 9223372039002259457N
+ :else 4294967296
+ :else 2)
+ (are [result input] (= result (case input
+ 9223372039002259457N :big
+ 1 :long
+ :else))
+ :long 1
+ :big 9223372039002259457N
+ :else 4294967296
+ :else 2)
+ (are [result input] (= result (case input
+ 0 :zero
+ -1 :neg1
+ 2 :two
+ :oops :OOPS))
+ :zero 0
+ :neg1 -1
+ :two 2
+ :OOPS :oops)
+ (are [result input] (= result (case input
+ 1204766517646190306 :a
+ 1 :b
+ -2 :c
+ :d))
+ :a 1204766517646190306
+ :b 1
+ :c -2
+ :d 4294967296
+ :d 3))
+ (testing "test warn for hash collision"
+ (should-print-err-message
+ #"Performance warning, .*:\d+ - hash collision of some case test constants; if selected, those entries will be tested sequentially..*\r?\n"
+ (case 1 1 :long 9223372039002259457N :big 2)))
+ (testing "test constants are *not* evaluated"
+ (let [test-fn
+ ;; never write code like this...
+ #(case %
+ (throw (Exception. "boom")) :piece-of-throw-expr ;;; RuntimeException
+ :no-match)]
+ (are [result input] (= result (test-fn input))
+ :piece-of-throw-expr 'throw
+ :piece-of-throw-expr '[Exception. "boom"] ;;; RuntimeException
+ :no-match nil))))
View
0  ...jure.Source/clojure/test_clojure/data.clj → ...ojure.Tests/clojure/test_clojure/data.clj
File renamed without changes
View
336 .../clojure/test_clojure/data_structures.clj → .../clojure/test_clojure/data_structures.clj
@@ -101,8 +101,8 @@
; sorted-set vs. hash-set
(is (not= (class (sorted-set 1)) (class (hash-set 1))))
(are [x y] (= x y)
- (sorted-set-by <) (hash-set)
- (sorted-set-by < 1) (hash-set 1)
+ (sorted-set-by <) (hash-set)
+ (sorted-set-by < 1) (hash-set 1)
(sorted-set-by < 3 2 1) (hash-set 3 2 1)
(sorted-set) (hash-set)
(sorted-set 1) (hash-set 1)
@@ -112,44 +112,44 @@
;; *** Collections ***
(deftest test-count
- (let [EMPTY clojure.lang.PersistentQueue/EMPTY]
- (are [x y] (= (count x) y)
- EMPTY 0
- (into EMPTY [:a :b]) 2
- (-> (into EMPTY [:a :b]) pop pop) 0
-
- nil 0
-
- () 0
- '(1) 1
- '(1 2 3) 3
-
- [] 0
- [1] 1
- [1 2 3] 3
-
- #{} 0
- #{1} 1
- #{1 2 3} 3
-
- {} 0
- {:a 1} 1
- {:a 1 :b 2 :c 3} 3
-
- "" 0
- "a" 1
- "abc" 3
-
- (into-array []) 0
- (into-array [1]) 1
- (into-array [1 2 3]) 3
-
- (System.Collections.ArrayList. []) 0 ;;; java.util.ArrayList.
- (System.Collections.ArrayList. [1]) 1 ;;; java.util.ArrayList.
- (System.Collections.ArrayList. [1 2 3]) 3 ;;; java.util.ArrayList.
-
- (System.Collections.Hashtable. {}) 0 ;;; java.util.HashMap.
- (System.Collections.Hashtable. {:a 1}) 1 ;;; java.util.HashMap.
+ (let [EMPTY clojure.lang.PersistentQueue/EMPTY]
+ (are [x y] (= (count x) y)
+ EMPTY 0
+ (into EMPTY [:a :b]) 2
+ (-> (into EMPTY [:a :b]) pop pop) 0
+
+ nil 0
+
+ () 0
+ '(1) 1
+ '(1 2 3) 3
+
+ [] 0
+ [1] 1
+ [1 2 3] 3
+
+ #{} 0
+ #{1} 1
+ #{1 2 3} 3
+
+ {} 0
+ {:a 1} 1
+ {:a 1 :b 2 :c 3} 3
+
+ "" 0
+ "a" 1
+ "abc" 3
+
+ (into-array []) 0
+ (into-array [1]) 1
+ (into-array [1 2 3]) 3
+
+ (System.Collections.ArrayList. []) 0 ;;; java.util.ArrayList.
+ (System.Collections.ArrayList. [1]) 1 ;;; java.util.ArrayList.
+ (System.Collections.ArrayList. [1 2 3]) 3 ;;; java.util.ArrayList.
+
+ (System.Collections.Hashtable. {}) 0 ;;; java.util.HashMap.
+ (System.Collections.Hashtable. {:a 1}) 1 ;;; java.util.HashMap.
(System.Collections.Hashtable. {:a 1 :b 2 :c 3}) 3 )) ;;; java.util.HashMap.
; different types
@@ -398,32 +398,32 @@
(contains? #{1 2 3} 10) false