/* Ċ Ġ* ĠPro Guard CORE Ġ-- Ġlibrary Ġto Ġprocess ĠJava Ġbytecode . Ċ Ġ* Ċ Ġ* ĠCopyright Ġ( c ) Ġ 2 0 0 2 - 2 0 2 2 ĠGu ards quare ĠNV Ċ Ġ* Ċ Ġ* ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ Ġ* Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ Ġ* ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ċ Ġ* Ċ Ġ* ĠĠĠĠĠ Ġhttp :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ġ* Ċ Ġ* ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ Ġ* Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ Ġ* ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ Ġ* ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ Ġ* Ġlimitations Ġunder Ġthe ĠLicense . Ċ Ġ*/ Ċ Ċ package Ġpro guard . analysis . cp a Ċ Ċ import Ġio . kot est . core . spec . style . Free Spec Ċ import Ġio . kot est . matchers . shouldBe Ċ import Ġpro guard . analysis . cp a . defaults . Stack Abstract State Ċ import Ġtest utils . cp a . Integer Abstract State Ċ Ċ class ĠStack Abstract State Test Ġ: ĠFree Spec ({ ĊĊĠĠĠ Ġval Ġstate Empty Ġ= ĠStack Abstract State < Integer Abstract State >() ĊĠĠĠ Ġval Ġstate Short 1 Ġ= ĠStack Abstract State < Integer Abstract State >() ĊĠĠĠ Ġval Ġstate Short 2 Ġ= ĠStack Abstract State < Integer Abstract State >() ĊĠĠĠ Ġval Ġstate Short Small Ġ= ĠStack Abstract State < Integer Abstract State >() ĊĠĠĠ Ġval Ġstate Long Ġ= ĠStack Abstract State < Integer Abstract State >() ĊĊĠĠĠ Ġstate Short 1 . push ( Integer Abstract State ( 3 )) ĊĠĠĠ Ġstate Short 1 . push ( Integer Abstract State ( 2 )) ĊĠĠĠ Ġstate Short 1 . push ( Integer Abstract State ( 1 )) ĊĊĠĠĠ Ġstate Short 2 . push ( Integer Abstract State ( 3 )) ĊĠĠĠ Ġstate Short 2 . push ( Integer Abstract State ( 4 )) ĊĠĠĠ Ġstate Short 2 . push ( Integer Abstract State (- 1 )) ĊĊĠĠĠ Ġstate Long . push ( Integer Abstract State ( 5 )) ĊĠĠĠ Ġstate Long . push ( Integer Abstract State ( 4 )) ĊĠĠĠ Ġstate Long . push ( Integer Abstract State ( 5 )) ĊĠĠĠ Ġstate Long . push ( Integer Abstract State (- 2 )) ĊĠĠĠ Ġstate Long . push ( Integer Abstract State ( 1 )) ĊĊĠĠĠ Ġstate Short Small . push ( Integer Abstract State (- 5 )) ĊĠĠĠ Ġstate Short Small . push ( Integer Abstract State (- 5 )) ĊĠĠĠ Ġstate Short Small . push ( Integer Abstract State (- 5 )) ĊĊĠĠĠ Ġ" Empty Ġstack Ġis Ġthe Ġneutral Ġelement " Ġ{ ĊĠĠĠĠĠĠĠ Ġstate Empty . join ( state Short 1 ) ĠshouldBe Ġstate Short 1 ĊĠĠĠĠĠĠĠ Ġstate Short 1 . join ( state Empty ) ĠshouldBe Ġstate Short 1 ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ" Stack s Ġof Ġthe Ġsame Ġsize Ġare Ġcorrectly Ġjoined " Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġresult Ġ= ĠStack Abstract State < Integer Abstract State >() ĊĠĠĠĠĠĠĠ Ġresult . push ( Integer Abstract State ( 3 )) ĊĠĠĠĠĠĠĠ Ġresult . push ( Integer Abstract State ( 4 )) ĊĠĠĠĠĠĠĠ Ġresult . push ( Integer Abstract State ( 1 )) ĊĊĠĠĠĠĠĠĠ Ġstate Short 1 . join ( state Short 2 ) ĠshouldBe Ġresult ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ" Stack s Ġof Ġthe Ġdifferent Ġsizes Ġare Ġcorrectly Ġjoined " Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġresult Ġ= ĠStack Abstract State < Integer Abstract State >() ĊĠĠĠĠĠĠĠ Ġresult . push ( Integer Abstract State ( 5 )) ĊĠĠĠĠĠĠĠ Ġresult . push ( Integer Abstract State ( 4 )) ĊĠĠĠĠĠĠĠ Ġresult . push ( Integer Abstract State ( 5 )) ĊĠĠĠĠĠĠĠ Ġresult . push ( Integer Abstract State ( 2 )) ĊĠĠĠĠĠĠĠ Ġresult . push ( Integer Abstract State ( 1 )) ĊĊĠĠĠĠĠĠĠ Ġstate Short 1 . join ( state Long ) ĠshouldBe Ġresult ĊĠĠĠĠĠĠĠ Ġstate Long . join ( state Short 1 ) ĠshouldBe Ġresult ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ" Comparison Ġis Ġref lex ive " Ġ{ ĊĠĠĠĠĠĠĠ Ġstate Short 1 . is Less OrEqual ( state Short 1 ) ĠshouldBe Ġtrue ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ" Comparison Ġis Ġant is ymmetric " Ġ{ ĊĠĠĠĠĠĠĠ Ġstate Short Small . is Less OrEqual ( state Short 1 ) ĠshouldBe Ġtrue ĊĠĠĠĠĠĠĠ Ġstate Short 1 . is Less OrEqual ( state Short Small ) ĠshouldBe Ġfalse ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ" Empty Ġstack Ġis Ġthe Ġbottom " Ġ{ ĊĠĠĠĠĠĠĠ Ġstate Empty . is Less OrEqual ( state Long ) ĠshouldBe Ġtrue ĊĠĠĠĠĠĠĠ Ġstate Long . is Less OrEqual ( state Empty ) ĠshouldBe Ġfalse ĊĠĠĠ Ġ} Ċ }) Ċ