This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
from sorts import * | |
class TestLab4(unittest.TestCase): | |
def test_simple(self): | |
"""Simple test for selection sort""" | |
nums = [23, 10] | |
comps = selection_sort(nums) | |
self.assertEqual(comps, 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
call plug#begin('~/.vim/plugged') | |
Plug 'itchyny/lightline.vim' | |
Plug 'scrooloose/nerdcommenter' | |
call plug#end() | |
if !has('gui_running') | |
set t_Co=256 | |
endif | |
set laststatus=2 | |
syntax on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Start of unittest - add to completely test functions in exp_eval | |
import unittest | |
from exp_eval import * | |
class test_expressions(unittest.TestCase): | |
def test_postfix_eval_addition(self): | |
"""Test subtraction with postfix_eval""" | |
self.assertAlmostEqual(postfix_eval("3 5 +"), 8) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
# from queue_array import Queue | |
from queue_linked import Queue | |
class TestLab1(unittest.TestCase): | |
def test_queue(self): | |
'''Trivial test to ensure method names and parameters are correct''' | |
q = Queue(5) | |
q.is_empty() | |
q.is_full() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
# Use the imports below to test either your array-based stack | |
# or your link-based version | |
from stack_array import Stack | |
# from stack_linked import Stack | |
class TestLab2(unittest.TestCase): | |
def test_simple(self): | |
"""Test simple stack operations""" |
NewerOlder