<commit_before>;;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: BLACK-STONE-TEST; Base: 10 -*-
;;;; file: t/black-stone.lisp

;;;; Copyright (c) 2013--2015, "the Phoeron" <NAME> <//thephoeron.com>
;;;; See LICENSE for additional information.

(in-package :cl-user)

(defpackage black-stone-test
  (:use cl black-stone prove))

(in-package :black-stone-test)

;; NOTE: To run this test file, execute `(asdf:test-system :bit-smasher)' in your Lisp.

(plan 5)

(deftest sanity-check
  (pass "PROVE is loaded and ready to go.")
  (ok (= 1 1)
      "Numeric equality: (= 1 1) => T.")
  (is (+ 1 1)
      2
      "Addition: (+ 1 1) => 2.")
  (is (* 2 2)
      4
      "Multiplication: (* 2 2) => 4.")
  (is (mod (+ 10 2) 10)
      2
      "Modulus: (mod (+ 10 2) 10) => 2."))

(deftest qubits
  (is-type (make-instance 'qubit)
           'qubit
           "Qubit created successfully.")
  (is (black-stone::qubit-state (make-instance 'qubit))
      1.0
      "The State of the Qubit is 1.0.")
  (is (black-stone::alpha (make-instance 'qubit))
      0.0
      "Alpha: 0.0")
  (is (black-stone::beta (make-instance 'qubit))
      1.0
      "Beta: 1.0")
  (is (black-stone::pure-state (make-instance 'qubit))
      #C(0.0 0.7071067932881648)
      "Pure Qubit State: ~#C(0.0 0.71)"))

(deftest quantum-coupler
  (is-type (make-instance 'quantum-coupler)
           'quantum-coupler
           "Quantum Coupler created successfully."))

(deftest quantum-register
  (is-type (make-instance 'quantum-register)
           'quantum-register
           "Quantum Register created successfully."))

(deftest without-branches
  (let ((p1 '((foo)
              (bar)
              (end)
              (baz)
              (bingo)
              (end)
              (biff)
              (boff)))
        (p2 '((foo)
              (bar)
              (measure 0)<commit_msg>Extend quantum-register test with ebits base unit<commit_after>;;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: BLACK-STONE-TEST; Base: 10 -*-
;;;; file: t/black-stone.lisp

;;;; Copyright (c) 2013--2015, "the Phoeron" <NAME> <//thephoeron.com>
;;;; See LICENSE for additional information.

(in-package :cl-user)

(defpackage black-stone-test
  (:use cl black-stone prove))

(in-package :black-stone-test)

;; NOTE: To run this test file, execute `(asdf:test-system :bit-smasher)' in your Lisp.

(plan 5)

(deftest sanity-check
  (pass "PROVE is loaded and ready to go.")
  (ok (= 1 1)
      "Numeric equality: (= 1 1) => T.")
  (is (+ 1 1)
      2
      "Addition: (+ 1 1) => 2.")
  (is (* 2 2)
      4
      "Multiplication: (* 2 2) => 4.")
  (is (mod (+ 10 2) 10)
      2
      "Modulus: (mod (+ 10 2) 10) => 2."))

(deftest qubits
  (is-type (make-instance 'qubit)
           'qubit
           "Qubit created successfully.")
  (is (black-stone::qubit-state (make-instance 'qubit))
      1.0
      "The State of the Qubit is 1.0.")
  (is (black-stone::alpha (make-instance 'qubit))
      0.0
      "Alpha: 0.0")
  (is (black-stone::beta (make-instance 'qubit))
      1.0
      "Beta: 1.0")
  (is (black-stone::pure-state (make-instance 'qubit))
      #C(0.0 0.7071067932881648)
      "Pure Qubit State: ~#C(0.0 0.71)"))

(deftest quantum-coupler
  (is-type (make-instance 'quantum-coupler)
           'quantum-coupler
           "Quantum Coupler created successfully."))

(deftest quantum-register
  (is-type (make-instance 'quantum-register)
           'quantum-register
           "Quantum Register created successfully.")
  (is-type (make-instance 'quantum-register :base-unit 2)
           'quantum-register
           "Quantum Register with ebits base unit created successfully."))

(deftest without-branches
  (let ((p1 '((foo)
              (bar)
              (end)
              (baz)
              (bingo)
              (end)
              (biff)
              (boff)))
        (p2 '((foo)
              (bar)
              (measure 0)
{'fraction_non_alphanumeric': 0.16295157571099156, 'fraction_numerical': 0.04022546758903408, 'mean_word_length': 2.158576051779935, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1412937', 'n_tokens_mistral': 1508, 'n_tokens_neox': 1358, 'n_words': 371}