UNPKG

sku-pg

Version:

Skulpt is a Javascript implementation of Python 2.x. Python that runs in your browser!

42 lines (36 loc) 992 B
<!DOCTYPE html> <html> <!-- Copyright 2008 The Closure Library Authors. All Rights Reserved. Use of this source code is governed by the Apache License, Version 2.0. See the COPYING file for details. --> <!-- --> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Closure Unit Tests - goog.testing.MockRange</title> <script src="../base.js"></script> <script> goog.require('goog.testing.MockRange'); goog.require('goog.testing.jsunit'); </script> </head> <body> <script> /** * Tests that a MockRange can be created successfully, a call to a mock * method can be recorded, and the correct behavior replayed and verified. */ function testMockMethod() { var mockRange = new goog.testing.MockRange(); mockRange.getStartOffset().$returns(42); mockRange.$replay(); assertEquals('Mock method should return recorded value', 42, mockRange.getStartOffset()); mockRange.$verify(); } </script> </body> </html>