Skip to content

Instantly share code, notes, and snippets.

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)
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
# 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)
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()
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"""