Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  IntegerT.vdmpp

  Sprache: VDM
 

class IntegerT is subclass of TestDriver
functions
public tests : () -> seq of TestCase
tests () == 
 [ new IntegerT01(), new IntegerT02()
 ];
end IntegerT
---------------------------------------
class IntegerT01 is subclass of TestCase
operations 
protected test: () ==> bool
test() == 
 let i = new Integer()  in
 return
  (i.asString(1234567890) = "1234567890" and
  i.asString(-1234567890) = "-1234567890" and
  i.asStringZ("zzz9")(9900) = "9900" and
  i.asStringZ("9")(0) = "0" and
  i.asStringZ("z")(0) = " " and
  i.asStringZ("z")(9) = "9" and
  i.asStringZ("zzz9")(9) = "   9" and
  i.asStringZ("0009")(9) = "0009" and
  i.asStringZ("-0009")(9) = "0009" and
  i.asStringZ("-zzz9")(-9999) = "-9999" and
  i.asStringZ("-zzz9")(-9) = "-   9" and
  i.asStringZ("zzz9")(-9999) = "9999" and
  i.asStringZ("zzz9")(-9) = "   9" and
  i.asString(0) = "0" and
  i.asChar(0) = "0" and 
  i.asChar(1) = "1" and
  i.asChar(2) = "2" and
  i.asChar(3) = "3" and
  i.asChar(4) = "4" and 
  i.asChar(5) = "5" and 
  i.asChar(6) = "6" and
  i.asChar(7) = "7" and
  i.asChar(8) = "8" and
  i.asChar(9) = "9" and
  i.asChar(10) = false
  )
;
protected setUp: () ==> ()
setUp() == TestName := "IntegerT01:\tConvert integer to string.";
protected tearDown: () ==> ()
tearDown() == return;
end IntegerT01
---------------------------------------

class IntegerT02 is subclass of TestCase
operations 
protected test: () ==> bool
test() == 
 let gcd = Integer`GCD(24),
  lcm = Integer`LCM(7)
 in
 return
  Sequence`fmap[natnat](gcd)([364816]) = [12248]  and
  Sequence`fmap[natnat](lcm)([345]) = [212835]
;
protected setUp: () ==> ()
setUp() == TestName := "IntegerT02:\tGet GCD and LCM.";
protected tearDown: () ==> ()
tearDown() == return;
end IntegerT02

Messung V0.5 in Prozent
C=97 H=100 G=98

¤ Dauer der Verarbeitung: 0.10 Sekunden  (vorverarbeitet am  2026-06-08) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik