#import <Foundation/Foundation.h>
#import "Testing.h"

/**
   The test tries to scan up to a pattern at the start of a string
   and checks it returns YES and compares the second argument with
   an empty string "".
 */
int main(int argc, char **argv, char **env) {
  NSString *str = @"/** comment */";
  NSScanner *scan;
  NSString *comment = nil;

  START_SET("scan a pattern at the start of a string")

  scan = [NSScanner scannerWithString: str];

  pass([scan scanUpToString: @"/**" intoString: &comment], "NSScanner tries to find a pattern at the start");
  pass([comment isEqualToString: @""], "NSScanner returns empty string");

  END_SET("scan a pattern at the start of a string")

  return 0;
}
