Changeset 646 for branches/decorate/test_wrapper.py
- Timestamp:
- 01/18/13 06:20:57 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/decorate/test_wrapper.py
r629 r646 126 126 127 127 128 def test_discrete():129 130 @discrete([1.0, 3.5, 5.5, 7.0])131 def discrete_squared(x):132 return x**2133 134 assert discrete_squared(5.6) == 5.5**2135 assert all(discrete_squared(asarray([1, 3])) == asarray([1.0, 3.5])**2)136 discrete_squared.samples([1.0, 7.0])137 assert discrete_squared(5.6) == 7.0**2138 discrete_squared.index([0, -1])139 assert all(discrete_squared(asarray([0, 3, 6])) == asarray([1.0, 3.0, 7.0])**2)140 141 142 128 if __name__ == '__main__': 143 129 test_monitored() … … 146 132 test_bounded() 147 133 test_mixedin() 148 test_discrete()149 134 test_clip_bounded() 150 135 test_target_bounded()
Note: See TracChangeset
for help on using the changeset viewer.