             k.on(.next(!n))
         })
     }
+
+    #if TRACE_RESOURCES
+        func testTakeReleasesResourcesOnComplete() {
+            _ = Observable<Int>.of(1, 2).take(1).subscribe()
+        }
+
+        func testTakeReleasesResourcesOnError() {
+            _ = Observable<Int>.error(testError).take(1).subscribe()
+        }
+    #endif
 }
 
 // MARK: takeLast


        XCTAssertEqual(elements, [false])
    }
}

// MARK: skip

            Subscription(200, 350)
            ])
    }

    #if TRACE_RESOURCES
        func testSkipWhileReleasesResourcesOnComplete() {
            _ = Observable<Int>.just(1).skipWhile { _ in true }.subscribe()
        }

        func testSkipWhileReleasesResourcesOnError() {
            _ = Observable<Int>.error(testError).skipWhile { _ in true }.subscribe()
        }

        func testSkipWhileWithIndexReleasesResourcesOnComplete() {
            _ = Observable<Int>.just(1).skipWhileWithIndex { _ in true }.subscribe()
        }

        func testSkipWhileWithIndexReleasesResourcesOnError() {
            _ = Observable<Int>.error(testError).skipWhileWithIndex { _ in true }.subscribe()
        }
    #endif
}

// MARK: elementAt
