Skip to content

Commit

Permalink
Make namespaces optional
Browse files Browse the repository at this point in the history
  • Loading branch information
aw committed Mar 9, 2017
1 parent 0a7c381 commit 79036b0
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 15 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 2.0.0 (2017-03-09)

* Remove the use of PicoLisp namespaces (functionally equivalent to 1.0.0)

## 1.0.0 (2015-06-09)

* Production release
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015 Alexander Williams, Unscramble <license@unscramble.jp>
Copyright (c) 2017 Alexander Williams, Unscramble <license@unscramble.jp>

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ Here are some guidelines on how to use `unit.l`, but you're free to poke around

There exists a few public functions: `(execute)`, `(report)`, and a bunch of `(assert-X)` where X is a type of assertion.

> **Note for 64-bit PicoLisp:** you can use `(symbols 'unit)` (or the prefix: `unit~`).
> **Note:** Namespaces can be disabled by setting the environment variable `PIL_NO_NAMESPACES=true`
> **Note for 64-bit PicoLisp:** you can use `(symbols 'unit)` (or the prefix: `unit~`). Ignored if `PIL_NO_NAMESPACES=true`
> **Note for 32-bit PicoLisp:** you don't have access to `(symbols)`, so these functions might clash with existing ones.
Expand Down Expand Up @@ -246,4 +248,4 @@ If you want to improve this library, please make a pull-request.

[MIT License](LICENSE)

Copyright (c) 2015 Alexander Williams, Unscramble <license@unscramble.jp>
Copyright (c) 2017 Alexander Williams, Unscramble <license@unscramble.jp>
4 changes: 2 additions & 2 deletions module.l
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[de MODULE_INFO
("name" "unit")
("version" "1.0.0")
("version" "2.0.0")
("summary" "Unit Testing framework for PicoLisp")
("source" "https://github.com/aw/picolisp-unit.git")
("author" "Alexander Williams")
("license" "MIT")
("copyright" "(c) 2015 Alexander Williams, Unscramble <license@unscramble.jp>") ]
("copyright" "(c) 2017 Alexander Williams, Unscramble <license@unscramble.jp>") ]
7 changes: 4 additions & 3 deletions reporters/default.l
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2015 Alexander Williams, Unscramble <license@unscramble.jp>
# Copyright (c) 2017 Alexander Williams, Unscramble <license@unscramble.jp>

(local *Colours print-report print-passed print-failed report-failed print-error)
(local print-expected print-got exit-gracefully)
(unless (sys "PIL_NO_NAMESPACES")
(local *Colours print-report print-passed print-failed report-failed print-error)
(local print-expected print-got exit-gracefully) )

(de *Colours ("red" . 1)
("green" . 2)
Expand Down
4 changes: 2 additions & 2 deletions reporters/plain.l
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2015 Alexander Williams, Unscramble <license@unscramble.jp>
# Copyright (c) 2017 Alexander Williams, Unscramble <license@unscramble.jp>

(local print-report)
(unless (sys "PIL_NO_NAMESPACES") (local print-report))

[de print-report ()
(mapcar println *Results)
Expand Down
3 changes: 2 additions & 1 deletion test.l
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env pil

(when symbols (symbols 'unit 'pico))
(unless (sys "PIL_NO_NAMESPACES")
(when symbols (symbols 'unit 'pico)) )

(load "unit.l")

Expand Down
9 changes: 5 additions & 4 deletions unit.l
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2015 Alexander Williams, Unscramble <license@unscramble.jp>
# Copyright (c) 2017 Alexander Williams, Unscramble <license@unscramble.jp>

(when symbols (symbols 'unit 'pico))
(unless (sys "PIL_NO_NAMESPACES")
(when symbols (symbols 'unit 'pico))

(local MODULE_INFO *My_tests_are_order_dependent *Results)
(local randomize passed failed queue-results colour plural? get-results)
(local MODULE_INFO *My_tests_are_order_dependent *Results)
(local randomize passed failed queue-results colour plural? get-results) )

(load (pack (car (file)) "module.l"))
(load (pack (car (file)) "reporters/" (if (sys "TEST_REPORTER") @ "default") ".l"))
Expand Down

0 comments on commit 79036b0

Please sign in to comment.